1 #ifndef DataFormats_Common_DataFrameContainer_h 2 #define DataFormats_Common_DataFrameContainer_h 6 #include <boost/iterator/transform_iterator.hpp> 7 #include <boost/iterator/counting_iterator.hpp> 16 template<
typename DigiCollection>
38 typedef std::vector<id_type>::iterator
IdIter;
39 typedef std::vector<data_type>::iterator
DataIter;
58 typedef boost::transform_iterator<IterHelp,boost::counting_iterator<int> >
const_iterator;
81 void swap(IdContainer & iic, DataContainer & idc) {
99 void push_back(id_type iid, data_type
const * idata) {
100 m_ids.push_back(iid);
107 m_ids.push_back(iid);
111 void set_back(id_type iid, data_type
const * idata) {
139 const_IterPair
pair(
size_t i)
const {
152 const_iterator
find(id_type
i)
const {
154 return (p==
m_ids.end() || (*p)!=
i) ?
end() :
155 boost::make_transform_iterator(boost::counting_iterator<int>(p-
m_ids.begin()),
160 return boost::make_transform_iterator(boost::counting_iterator<int>(0),
163 const_iterator
end()
const {
164 return boost::make_transform_iterator(boost::counting_iterator<int>(
size()),
181 data_type
const *
frame(
size_t cell)
const {
185 id_type
id(
size_t cell)
const {
194 friend class ::TestDataFrame;
196 template<
typename DigiCollection>
197 friend class ::TestEcalDigi;
241 #endif // DataFormats_Common_DataFrameContainer_h
data_type operator()(size_t cell, size_t frame) const
IdContainer const & ids() const
std::pair< IdIter, DataIter > IterPair
void resize(size_t isize)
boost::transform_iterator< IterHelp, boost::counting_iterator< int > > const_iterator
std::vector< data_type >::iterator DataIter
void push_back(id_type iid)
unique_ptr< ClusterSequence > cs
IterHelp(DataFrameContainer const &iv)
DataFrameContainer(size_t istride, int isubdet=0, size_t isize=0)
const_iterator begin() const
DataFrame operator[](size_t i) const
id_type id(size_t cell) const
void swap(Association< C > &lhs, Association< C > &rhs)
void swap(IdContainer &iic, DataContainer &idc)
DataFrame const & operator()(int i) const
const_iterator find(id_type i) const
std::vector< data_type > DataContainer
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
std::vector< data_type >::const_iterator const_DataIter
std::vector< id_type >::const_iterator const_IdIter
std::pair< const_IdIter, const_DataIter > const_IterPair
DataFrameContainer & operator=(DataFrameContainer const &rhs)
void swap(DataFrameContainer &rh)
std::vector< id_type >::iterator IdIter
void set_back(data_type const *idata)
void reserve(size_t isize)
void set(DataFrameContainer const &icont, size_type i)
DataFrameContainer const & v
void set_back(id_type iid)
void push_back(id_type iid, data_type const *idata)
const_iterator end() const
std::vector< id_type > IdContainer
DataFrame operator[](size_t i)
const_IterPair pair(size_t i) const
DataContainer const & data() const
void set_back(id_type iid, data_type const *idata)
data_type const * frame(size_t cell) const