1 #ifndef CondFormats_HcalObjects_HcalItemColl_h
2 #define CondFormats_HcalObjects_HcalItemColl_h
4 #include "boost/serialization/access.hpp"
5 #include "boost/serialization/version.hpp"
6 #include "boost/serialization/shared_ptr.hpp"
7 #include "boost/serialization/vector.hpp"
20 template <
typename Item>
26 inline void push_back(std::unique_ptr<Item> ptr) {
data_.push_back(std::shared_ptr<Item>(ptr.release())); }
33 inline std::size_t
size()
const {
return data_.size(); }
37 inline const Item*
get(
const unsigned index)
const {
45 inline const Item&
at(
const unsigned index)
const {
return *
data_.at(index); }
49 const std::size_t sz =
data_.size();
50 if (sz != r.
data_.size())
52 for (std::size_t
i = 0;
i < sz; ++
i)
61 std::vector<std::shared_ptr<Item> >
data_;
63 friend class boost::serialization::access;
65 template <
class Archive>
73 namespace serialization {
74 template <
typename Item>
76 BOOST_STATIC_CONSTANT(
int,
value = 1);
81 #endif // CondFormats_HcalObjects_HcalItemColl_h
void reserve(const unsigned n)
void serialize(Archive &ar, unsigned)
bool operator!=(const HcalItemColl &r) const
bool operator==(const HcalItemColl &r) const
std::vector< std::shared_ptr< Item > > data_
const Item & at(const unsigned index) const
void push_back(std::unique_ptr< Item > ptr)