1 #ifndef CondFormats_HcalObjects_HcalItemArrayColl_h 2 #define CondFormats_HcalObjects_HcalItemArrayColl_h 7 #include "boost/array.hpp" 8 #include "boost/serialization/access.hpp" 9 #include "boost/serialization/version.hpp" 10 #include "boost/serialization/shared_ptr.hpp" 11 #include "boost/serialization/vector.hpp" 12 #include "boost/serialization/array.hpp" 20 template<
typename Item,
unsigned N>
33 for (
unsigned i=0;
i<
N; ++
i)
34 st[
i] = boost::shared_ptr<Item>(arr[
i].
release());
43 inline std::size_t
size()
const {
return data_.size();}
48 inline const Item*
get(
const unsigned itemIndex,
49 const unsigned arrayIndex)
const 51 if (itemIndex <
data_.size() && arrayIndex <
N)
52 return data_[itemIndex][arrayIndex].
get();
59 inline Item&
at(
const unsigned itemIndex,
const unsigned arrayIndex)
const 60 {
return *
data_.at(itemIndex).at(arrayIndex);}
65 const std::size_t sz =
data_.size();
66 if (sz != r.
data_.size())
68 for (std::size_t
i=0;
i<sz; ++
i)
69 for (
unsigned j=0; j<
N; ++j)
76 {
return !(*
this ==
r);}
84 template<
class Archive>
93 namespace serialization {
94 template<
typename Item,
unsigned N>
97 BOOST_STATIC_CONSTANT(
int,
value = 1);
102 #endif // CondFormats_HcalObjects_HcalItemArrayColl_h
friend class boost::serialization::access
void reserve(const unsigned n)
bool operator==(const HcalItemArrayColl &r) const
static constexpr unsigned arraySize()
bool operator!=(const HcalItemArrayColl &r) const
std::vector< StoredArray > data_
Item & at(const unsigned itemIndex, const unsigned arrayIndex) const
void push_back(InputArray &arr)
std::array< std::unique_ptr< Item >, N > InputArray
boost::array< boost::shared_ptr< Item >, N > StoredArray
void serialize(Archive &ar, unsigned)