1 #ifndef CondFormats_HcalObjects_HcalItemArrayColl_h 2 #define CondFormats_HcalObjects_HcalItemArrayColl_h 7 #include "boost/serialization/access.hpp" 8 #include "boost/serialization/version.hpp" 9 #include "boost/serialization/shared_ptr.hpp" 10 #include "boost/serialization/vector.hpp" 11 #include "boost/serialization/array.hpp" 19 template<
typename Item,
unsigned N>
32 for (
unsigned i=0;
i<
N; ++
i)
33 st[
i] = boost::shared_ptr<Item>(arr[
i].
release());
42 inline std::size_t
size()
const {
return data_.size();}
47 inline const Item*
get(
const unsigned itemIndex,
48 const unsigned arrayIndex)
const 50 if (itemIndex <
data_.size() && arrayIndex <
N)
51 return data_[itemIndex][arrayIndex].
get();
58 inline Item&
at(
const unsigned itemIndex,
const unsigned arrayIndex)
const 59 {
return *
data_.at(itemIndex).at(arrayIndex);}
64 const std::size_t sz =
data_.size();
65 if (sz != r.
data_.size())
67 for (std::size_t
i=0;
i<sz; ++
i)
68 for (
unsigned j=0;
j<
N; ++
j)
75 {
return !(*
this ==
r);}
83 template<
class Archive>
92 namespace serialization {
93 template<
typename Item,
unsigned N>
96 BOOST_STATIC_CONSTANT(
int,
value = 1);
101 #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)