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/version.hpp" 13 #if BOOST_VERSION < 106400 14 #include "boost/serialization/array.hpp" 16 #include "boost/serialization/boost_array.hpp" 25 template<
typename Item,
unsigned N>
38 for (
unsigned i=0;
i<
N; ++
i)
39 st[
i] = boost::shared_ptr<Item>(arr[
i].
release());
48 inline std::size_t
size()
const {
return data_.size();}
53 inline const Item*
get(
const unsigned itemIndex,
54 const unsigned arrayIndex)
const 56 if (itemIndex <
data_.size() && arrayIndex <
N)
57 return data_[itemIndex][arrayIndex].
get();
64 inline Item&
at(
const unsigned itemIndex,
const unsigned arrayIndex)
const 65 {
return *
data_.at(itemIndex).at(arrayIndex);}
70 const std::size_t sz =
data_.size();
71 if (sz != r.
data_.size())
73 for (std::size_t
i=0;
i<sz; ++
i)
74 for (
unsigned j=0; j<
N; ++j)
81 {
return !(*
this ==
r);}
89 template<
class Archive>
98 namespace serialization {
99 template<
typename Item,
unsigned N>
102 BOOST_STATIC_CONSTANT(
int,
value = 1);
107 #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)