CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
OOTPileupCorrectionColl.h
Go to the documentation of this file.
1 #ifndef CondFormats_HcalObjects_OOTPileupCorrectionColl_h
2 #define CondFormats_HcalObjects_OOTPileupCorrectionColl_h
3 
4 #include <string>
5 
6 #include "boost/serialization/shared_ptr.hpp"
7 #include "boost/serialization/map.hpp"
8 
10 
12 {
13 public:
14  inline void add(const std::string& name, const std::string& category,
15  boost::shared_ptr<AbsOOTPileupCorrection> ptr)
16  {
17  data_[category][name] = ptr;
18  }
19 
20  inline void clear() {data_.clear();}
21 
22  inline bool empty() const {return data_.empty();}
23 
24  boost::shared_ptr<AbsOOTPileupCorrection> get(
25  const std::string& name, const std::string& category) const;
26 
27  bool exists(const std::string& name, const std::string& category) const;
28 
29  bool operator==(const OOTPileupCorrectionColl& r) const;
30 
31  inline bool operator!=(const OOTPileupCorrectionColl& r) const
32  {return !(*this == r);}
33 
34 private:
35  typedef std::map<std::string, boost::shared_ptr<AbsOOTPileupCorrection> > PtrMap;
36  typedef std::map<std::string, PtrMap> DataMap;
38 
40 
41  template<class Archive>
42  inline void serialize(Archive & ar, unsigned /* version */)
43  {
44  ar & data_;
45  }
46 };
47 
48 #endif // CondFormats_HcalObjects_OOTPileupCorrectionColl_h
friend class boost::serialization::access
std::map< std::string, PtrMap > DataMap
std::map< std::string, boost::shared_ptr< AbsOOTPileupCorrection > > PtrMap
bool operator==(const OOTPileupCorrectionColl &r) const
void serialize(Archive &ar, unsigned)
void add(const std::string &name, const std::string &category, boost::shared_ptr< AbsOOTPileupCorrection > ptr)
bool operator!=(const OOTPileupCorrectionColl &r) const
bool exists(const std::string &name, const std::string &category) const