CMS 3D CMS Logo

HcalConstFunctor.h
Go to the documentation of this file.
1 #ifndef CondFormats_HcalObjects_HcalConstFunctor_h
2 #define CondFormats_HcalObjects_HcalConstFunctor_h
3 
5 
6 #include "boost/serialization/access.hpp"
7 #include "boost/serialization/version.hpp"
8 
9 //
10 // A functor returning a constant value
11 //
13 {
14 public:
15  // Dummy constructor, to be used for deserialization only
17 
18  // Normal constructor
19  explicit HcalConstFunctor(const double value);
20 
21  inline virtual ~HcalConstFunctor() {}
22 
23  virtual double operator()(double x) const override;
24 
25 protected:
26  inline virtual bool isEqual(const AbsHcalFunctor& other) const override
27  {
28  const HcalConstFunctor& r = static_cast<const HcalConstFunctor&>(other);
29  return value_ == r.value_;
30  }
31 
32 private:
33  double value_;
34 
36 
37  template<class Archive>
38  inline void serialize(Archive & ar, unsigned /* version */)
39  {
40  boost::serialization::base_object<AbsHcalFunctor>(*this);
41  ar & value_;
42  }
43 };
44 
45 BOOST_CLASS_VERSION(HcalConstFunctor, 1)
46 BOOST_CLASS_EXPORT_KEY(HcalConstFunctor)
47 
48 #endif // CondFormats_HcalObjects_HcalConstFunctor_h
friend class boost::serialization::access
virtual ~HcalConstFunctor()
virtual double operator()(double x) const override
Definition: value.py:1
void serialize(Archive &ar, unsigned)
virtual bool isEqual(const AbsHcalFunctor &other) const override