CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Private Attributes | Friends
HcalItemArrayColl< Item, N > Class Template Reference

#include <HcalItemArrayColl.h>

Public Types

typedef std::array< std::unique_ptr< Item >, NInputArray
 
typedef Item value_type
 

Public Member Functions

Item & at (const unsigned itemIndex, const unsigned arrayIndex) const
 
void clear ()
 
bool empty () const
 
const Item * get (const unsigned itemIndex, const unsigned arrayIndex) const
 
bool operator!= (const HcalItemArrayColl &r) const
 
bool operator== (const HcalItemArrayColl &r) const
 
void push_back (InputArray &arr)
 
void reserve (const unsigned n)
 
std::size_t size () const
 

Static Public Member Functions

static constexpr unsigned arraySize ()
 

Private Types

typedef boost::array< boost::shared_ptr< Item >, NStoredArray
 

Private Member Functions

template<class Archive >
void serialize (Archive &ar, unsigned)
 

Private Attributes

std::vector< StoredArraydata_
 

Friends

class boost::serialization::access
 

Detailed Description

template<typename Item, unsigned N>
class HcalItemArrayColl< Item, N >

Definition at line 20 of file HcalItemArrayColl.h.

Member Typedef Documentation

template<typename Item, unsigned N>
typedef std::array<std::unique_ptr<Item>,N> HcalItemArrayColl< Item, N >::InputArray

Definition at line 24 of file HcalItemArrayColl.h.

template<typename Item, unsigned N>
typedef boost::array<boost::shared_ptr<Item>,N> HcalItemArrayColl< Item, N >::StoredArray
private

Definition at line 78 of file HcalItemArrayColl.h.

template<typename Item, unsigned N>
typedef Item HcalItemArrayColl< Item, N >::value_type

Definition at line 23 of file HcalItemArrayColl.h.

Member Function Documentation

template<typename Item, unsigned N>
static constexpr unsigned HcalItemArrayColl< Item, N >::arraySize ( )
inlinestatic

Definition at line 25 of file HcalItemArrayColl.h.

References N.

25 {return N;}
#define N
Definition: blowfish.cc:9
template<typename Item, unsigned N>
Item& HcalItemArrayColl< Item, N >::at ( const unsigned  itemIndex,
const unsigned  arrayIndex 
) const
inline

Definition at line 58 of file HcalItemArrayColl.h.

References HcalItemArrayColl< Item, N >::data_.

59  {return *data_.at(itemIndex).at(arrayIndex);}
std::vector< StoredArray > data_
template<typename Item, unsigned N>
void HcalItemArrayColl< Item, N >::clear ( void  )
inline
template<typename Item, unsigned N>
bool HcalItemArrayColl< Item, N >::empty ( ) const
inline
template<typename Item, unsigned N>
const Item* HcalItemArrayColl< Item, N >::get ( const unsigned  itemIndex,
const unsigned  arrayIndex 
) const
inline
template<typename Item, unsigned N>
bool HcalItemArrayColl< Item, N >::operator!= ( const HcalItemArrayColl< Item, N > &  r) const
inline

Definition at line 74 of file HcalItemArrayColl.h.

References alignCSCRings::r.

75  {return !(*this == r);}
template<typename Item, unsigned N>
bool HcalItemArrayColl< Item, N >::operator== ( const HcalItemArrayColl< Item, N > &  r) const
inline

Definition at line 62 of file HcalItemArrayColl.h.

References HcalItemArrayColl< Item, N >::data_, i, j, and N.

63  {
64  const std::size_t sz = data_.size();
65  if (sz != r.data_.size())
66  return false;
67  for (std::size_t i=0; i<sz; ++i)
68  for (unsigned j=0; j<N; ++j)
69  if (!(*data_[i][j] == *r.data_[i][j]))
70  return false;
71  return true;
72  }
int i
Definition: DBlmapReader.cc:9
int j
Definition: DBlmapReader.cc:9
std::vector< StoredArray > data_
#define N
Definition: blowfish.cc:9
template<typename Item, unsigned N>
void HcalItemArrayColl< Item, N >::push_back ( InputArray arr)
inline

Definition at line 29 of file HcalItemArrayColl.h.

References HcalItemArrayColl< Item, N >::data_, i, N, and fetchall_from_DQM_v2::release.

30  {
31  StoredArray st;
32  for (unsigned i=0; i<N; ++i)
33  st[i] = boost::shared_ptr<Item>(arr[i].release());
34  data_.push_back(st);
35  }
int i
Definition: DBlmapReader.cc:9
std::vector< StoredArray > data_
#define N
Definition: blowfish.cc:9
boost::array< boost::shared_ptr< Item >, N > StoredArray
template<typename Item, unsigned N>
void HcalItemArrayColl< Item, N >::reserve ( const unsigned  n)
inline

Definition at line 39 of file HcalItemArrayColl.h.

References HcalItemArrayColl< Item, N >::data_.

39 {data_.reserve(n);}
std::vector< StoredArray > data_
template<typename Item, unsigned N>
template<class Archive >
void HcalItemArrayColl< Item, N >::serialize ( Archive &  ar,
unsigned   
)
inlineprivate

Definition at line 84 of file HcalItemArrayColl.h.

References HcalItemArrayColl< Item, N >::data_.

85  {
86  ar & data_;
87  }
std::vector< StoredArray > data_
template<typename Item, unsigned N>
std::size_t HcalItemArrayColl< Item, N >::size ( void  ) const
inline

Definition at line 42 of file HcalItemArrayColl.h.

References HcalItemArrayColl< Item, N >::data_.

Referenced by ntuple._Collection::__iter__(), and ntuple._Collection::__len__().

42 {return data_.size();}
std::vector< StoredArray > data_

Friends And Related Function Documentation

template<typename Item, unsigned N>
friend class boost::serialization::access
friend

Definition at line 81 of file HcalItemArrayColl.h.

Member Data Documentation

template<typename Item, unsigned N>
std::vector<StoredArray> HcalItemArrayColl< Item, N >::data_
private