CMS 3D CMS Logo

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  public:
26 
28  inline explicit StorableMultivariateFunctor(const std::string& descr)
30 
31  inline ~StorableMultivariateFunctor() override {}
32 
34  inline const std::string& description() const { return description_; }
35 
37  inline void setDescription(const std::string& newDescription) { description_ = newDescription; }
38 
43  void validateDescription(const std::string& description) const;
44 
46 
50  inline bool operator==(const StorableMultivariateFunctor& r) const {
51  return (typeid(*this) == typeid(r)) && this->isEqual(r);
52  }
53  inline bool operator!=(const StorableMultivariateFunctor& r) const { return !(*this == r); }
55 
57 
58  virtual gs::ClassId classId() const = 0;
59  virtual bool write(std::ostream& of) const = 0;
61 
62  // I/O methods needed for reading
63  static inline const char* classname() { return "npstat::StorableMultivariateFunctor"; }
64  static inline unsigned version() { return 1; }
65  static StorableMultivariateFunctor* read(const gs::ClassId& id, std::istream& in);
66 
67  protected:
75  virtual bool isEqual(const StorableMultivariateFunctor&) const = 0;
76 
77  private:
79  };
80 } // namespace npstat
81 
82 #endif // NPSTAT_STORABLEMULTIVARIATEFUNCTOR_HH_
npstat::StorableMultivariateFunctor::description
const std::string & description() const
Definition: StorableMultivariateFunctor.h:34
npstat::AbsMultivariateFunctor
Definition: AbsMultivariateFunctor.h:18
npstat
Definition: AbsArrayProjector.h:14
npstat::StorableMultivariateFunctor::classId
virtual gs::ClassId classId() const =0
AbsMultivariateFunctor.h
Interface definition for multidimensional functors.
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
npstat::StorableMultivariateFunctor::~StorableMultivariateFunctor
~StorableMultivariateFunctor() override
Definition: StorableMultivariateFunctor.h:31
npstat::StorableMultivariateFunctor::operator==
bool operator==(const StorableMultivariateFunctor &r) const
Definition: StorableMultivariateFunctor.h:50
npstat::StorableMultivariateFunctor::StorableMultivariateFunctor
StorableMultivariateFunctor()
Definition: StorableMultivariateFunctor.h:25
npstat::StorableMultivariateFunctor::validateDescription
void validateDescription(const std::string &description) const
Definition: StorableMultivariateFunctor.cc:6
recoMuon::in
Definition: RecoMuonEnumerators.h:6
npstat::StorableMultivariateFunctor::isEqual
virtual bool isEqual(const StorableMultivariateFunctor &) const =0
alignCSCRings.r
r
Definition: alignCSCRings.py:93
npstat::StorableMultivariateFunctor::operator!=
bool operator!=(const StorableMultivariateFunctor &r) const
Definition: StorableMultivariateFunctor.h:53
npstat::StorableMultivariateFunctor
Definition: StorableMultivariateFunctor.h:23
npstat::StorableMultivariateFunctor::version
static unsigned version()
Definition: StorableMultivariateFunctor.h:64
npstat::StorableMultivariateFunctor::StorableMultivariateFunctor
StorableMultivariateFunctor(const std::string &descr)
Definition: StorableMultivariateFunctor.h:28
npstat::StorableMultivariateFunctor::description_
std::string description_
Definition: StorableMultivariateFunctor.h:78
npstat::StorableMultivariateFunctor::classname
static const char * classname()
Definition: StorableMultivariateFunctor.h:63
npstat::StorableMultivariateFunctor::write
virtual bool write(std::ostream &of) const =0
npstat::StorableMultivariateFunctor::read
static StorableMultivariateFunctor * read(const gs::ClassId &id, std::istream &in)
Definition: StorableMultivariateFunctor.cc:19
npstat::StorableMultivariateFunctor::setDescription
void setDescription(const std::string &newDescription)
Definition: StorableMultivariateFunctor.h:37