CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
StorableMultivariateFunctor.h
Go to the documentation of this file.
1 #ifndef NPSTAT_STORABLEMULTIVARIATEFUNCTOR_HH_
2 #define NPSTAT_STORABLEMULTIVARIATEFUNCTOR_HH_
3 
14 #include <string>
15 #include <iostream>
16 #include <typeinfo>
17 
18 #include "Alignment/Geners/interface/ClassId.hh"
20 
21 namespace npstat {
24  {
25  public:
27 
31 
32  inline virtual ~StorableMultivariateFunctor() {}
33 
35  inline const std::string& description() const {return description_;}
36 
38  inline void setDescription(const std::string& newDescription)
39  {description_ = newDescription;}
40 
45  void validateDescription(const std::string& description) const;
46 
48 
52  inline bool operator==(const StorableMultivariateFunctor& r) const
53  {return (typeid(*this) == typeid(r)) && this->isEqual(r);}
54  inline bool operator!=(const StorableMultivariateFunctor& r) const
55  {return !(*this == r);}
57 
59 
60  virtual gs::ClassId classId() const = 0;
61  virtual bool write(std::ostream& of) const = 0;
63 
64  // I/O methods needed for reading
65  static inline const char* classname()
66  {return "npstat::StorableMultivariateFunctor";}
67  static inline unsigned version() {return 1;}
69  const gs::ClassId& id, std::istream& in);
70 
71  protected:
79  virtual bool isEqual(const StorableMultivariateFunctor&) const = 0;
80 
81  private:
83  };
84 }
85 
86 #endif // NPSTAT_STORABLEMULTIVARIATEFUNCTOR_HH_
87 
void validateDescription(const std::string &description) const
bool operator==(const StorableMultivariateFunctor &r) const
virtual bool isEqual(const StorableMultivariateFunctor &) const =0
virtual gs::ClassId classId() const =0
static StorableMultivariateFunctor * read(const gs::ClassId &id, std::istream &in)
StorableMultivariateFunctor(const std::string &descr)
void setDescription(const std::string &newDescription)
bool operator!=(const StorableMultivariateFunctor &r) const
virtual bool write(std::ostream &of) const =0
Interface definition for multidimensional functors.