1 #ifndef CondFormats_HcalObjects_StorableDoubleMap_h 2 #define CondFormats_HcalObjects_StorableDoubleMap_h 8 #include "boost/serialization/map.hpp" 33 {
return !(*
this ==
r);}
36 typedef std::map<std::string, T*>
PtrMap;
37 typedef std::map<std::string, PtrMap>
DataMap;
40 friend class boost::serialization::access;
42 template<
class Archive>
53 const typename DataMap::iterator
end =
data_.end();
54 for (
typename DataMap::iterator dit =
data_.begin(); dit !=
end; ++dit)
56 const typename PtrMap::iterator pend = dit->second.end();
57 for (
typename PtrMap::iterator pit = dit->second.begin();
68 typename DataMap::const_iterator dit =
data_.find(category);
69 if (dit ==
data_.end())
72 return !(dit->second.find(name) == dit->second.end());
79 typename DataMap::const_iterator dit =
data_.find(category);
81 "In StorableDoubleMap::get: unknown category");
82 typename PtrMap::const_iterator pit = dit->second.find(name);
84 "In StorableDoubleMap::get: unknown name");
93 typename DataMap::const_iterator dit =
data_.begin();
94 const typename DataMap::const_iterator
end =
data_.end();
95 typename DataMap::const_iterator rit = r.
data_.begin();
96 for (; dit !=
end; ++dit, ++rit)
98 if (dit->first != rit->first)
100 if (dit->second.size() != rit->second.size())
102 typename PtrMap::const_iterator pit = dit->second.begin();
103 const typename PtrMap::const_iterator pend = dit->second.end();
104 typename PtrMap::const_iterator rpit = rit->second.begin();
105 for (; pit != pend; ++pit, ++rpit)
107 if (pit->first != rpit->first)
109 if (*(pit->second) != *(rpit->second))
116 #endif // CondFormats_HcalObjects_StorableDoubleMap_h
void serialize(Archive &ar, unsigned)
void add(const std::string &name, const std::string &category, std::auto_ptr< T > ptr)
bool operator==(const StorableDoubleMap &r) const
bool exists(const std::string &name, const std::string &category) const
bool operator!=(const StorableDoubleMap &r) const
std::map< std::string, T * > PtrMap
const T * get(const std::string &name, const std::string &category) const
std::map< std::string, PtrMap > DataMap