|
|
Go to the documentation of this file. 1 #ifndef CondFormats_HcalObjects_HcalItemArrayColl_h
2 #define CondFormats_HcalObjects_HcalItemArrayColl_h
4 #include "boost/array.hpp"
5 #include "boost/serialization/access.hpp"
6 #include "boost/serialization/version.hpp"
7 #include "boost/serialization/shared_ptr.hpp"
8 #include "boost/serialization/vector.hpp"
9 #include "boost/version.hpp"
10 #if BOOST_VERSION < 106400
11 #include "boost/serialization/array.hpp"
13 #include "boost/serialization/boost_array.hpp"
26 template <
typename Item,
unsigned N>
37 for (
unsigned i = 0;
i <
N; ++
i)
38 st[
i] = std::shared_ptr<Item>(arr[
i].
release());
47 inline std::size_t
size()
const {
return data_.size(); }
52 inline const Item*
get(
const unsigned itemIndex,
const unsigned arrayIndex)
const {
53 if (itemIndex <
data_.size() && arrayIndex <
N)
54 return data_[itemIndex][arrayIndex].
get();
61 inline Item&
at(
const unsigned itemIndex,
const unsigned arrayIndex)
const {
62 return *
data_.at(itemIndex).at(arrayIndex);
67 const std::size_t sz =
data_.size();
68 if (sz !=
r.data_.size())
70 for (std::size_t
i = 0;
i < sz; ++
i)
71 for (
unsigned j = 0;
j <
N; ++
j)
85 template <
class Archive>
93 namespace serialization {
94 template <
typename Item,
unsigned N>
96 BOOST_STATIC_CONSTANT(
int,
value = 1);
101 #endif // CondFormats_HcalObjects_HcalItemArrayColl_h
void reserve(const unsigned n)
friend class boost::serialization::access
const Item * get(const unsigned itemIndex, const unsigned arrayIndex) const
boost::array< std::shared_ptr< Item >, N > StoredArray
bool operator==(const HcalItemArrayColl &r) const
bool operator!=(const HcalItemArrayColl &r) const
static constexpr unsigned arraySize()
void push_back(InputArray &arr)
std::vector< StoredArray > data_
Item & at(const unsigned itemIndex, const unsigned arrayIndex) const
void serialize(Archive &ar, unsigned)
std::array< std::unique_ptr< Item >, N > InputArray