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 public:
14  // Dummy constructor, to be used for deserialization only
16 
17  // Normal constructor
18  explicit HcalConstFunctor(const double value);
19 
20  inline ~HcalConstFunctor() override {}
21 
22  double operator()(double x) const override;
23 
24 protected:
25  inline bool isEqual(const AbsHcalFunctor& other) const override {
26  const HcalConstFunctor& r = static_cast<const HcalConstFunctor&>(other);
27  return value_ == r.value_;
28  }
29 
30 private:
31  double value_;
32 
34 
35  template <class Archive>
36  inline void serialize(Archive& ar, unsigned /* version */) {
37  boost::serialization::base_object<AbsHcalFunctor>(*this);
38  ar & value_;
39  }
40 };
41 
42 BOOST_CLASS_VERSION(HcalConstFunctor, 1)
43 BOOST_CLASS_EXPORT_KEY(HcalConstFunctor)
44 
45 #endif // CondFormats_HcalObjects_HcalConstFunctor_h
friend class boost::serialization::access
double operator()(double x) const override
Definition: value.py:1
void serialize(Archive &ar, unsigned)
bool isEqual(const AbsHcalFunctor &other) const override
~HcalConstFunctor() override