1 #ifndef Fireworks_Core_FWItemRandomAccessor_h
2 #define Fireworks_Core_FWItemRandomAccessor_h
33 const void*
data()
const;
34 const TClass*
type()
const;
72 template <
class C,
class V =
typename C::value_type>
107 template <
class C,
class COLL =
typename C::value_type,
class V =
typename COLL::value_type >
126 size_t collectionOffset = 0;
127 for (
typename container_type::const_iterator ci = c->begin(), ce = c->end(); ci != ce; ++ci)
129 size_t i = iIndex - collectionOffset;
131 return &(ci->operator[](i));
132 collectionOffset += ci->size();
143 size_t finalSize = 0;
145 for (
typename container_type::const_iterator
i = c->begin(),
e = c->end();
i !=
e; ++
i)
146 finalSize +=
i->size();
154 template <
class C,
class COLL =
typename C::value_type,
class V =
typename COLL::value_type >
176 return &(c->data().operator[](iIndex));
184 return c->dataSize();
188 template <
class C,
class R =
typename C::Range,
class V =
typename R::value_type>
207 size_t collectionOffset = 0;
208 for (
typename container_type::const_iterator ci = c->begin(), ce = c->end(); ci != ce; ++ci)
210 size_t i = iIndex - collectionOffset;
211 if (i < std::distance(ci->first, ci->second))
213 collectionOffset += ci->size();
224 size_t finalSize = 0;
226 for (
typename range_type::const_iterator ci = c->begin(), ce = c->end(); ci != ce; ++ci)
227 finalSize += std::distance(ci->first, ci->second);
233 template <
class C,
class V>
251 size_t collectionOffset = 0;
253 for (
typename container_type::DigiRangeIterator ci = c->begin(), ce = c->end(); ci != ce; ++ci)
255 int i = iIndex - collectionOffset;
260 if (i < std::distance(vt.second.first, vt.second.second))
261 return &(*(vt.second.first + i));
262 collectionOffset += std::distance(vt.second.first, vt.second.second);
273 size_t finalSize = 0;
275 for (
typename container_type::DigiRangeIterator ci = c->begin(), ce = c->end(); ci != ce; ++ci)
278 finalSize += std::distance(vt.second.first, vt.second.second);
virtual ~FWItemRandomAccessorBase()
const TClass * type() const
FWItemDetSetAccessor(const TClass *iClass)
const void * data() const
const FWItemRandomAccessorBase & operator=(const FWItemRandomAccessorBase &)
FWItemRandomAccessorBase(const TClass *type, const type_info &modelTypeName)
bool isCollection() const
REGISTER_FWITEMACCESSOR_METHODS()
FWItemRandomAccessor(const TClass *iClass)
const void * modelData(int iIndex) const
REGISTER_FWITEMACCESSOR_METHODS()
unsigned int size() const
unsigned int size() const
const void * modelData(int iIndex) const
FWItemMuonDigiAccessor(const TClass *iClass)
const void * modelData(int iIndex) const
REGISTER_FWITEMACCESSOR_METHODS()
Container::value_type value_type
FWItemNewDetSetAccessor(const TClass *iClass)
void setData(const edm::ObjectWithDict &)
override if id of an object should be different than the index
REGISTER_FWITEMACCESSOR_METHODS()
const TClass * m_modelType
const void * modelData(int iIndex) const
unsigned int size() const
unsigned int size() const
unsigned int size() const
void * getDataPtr() const
const void * modelData(int iIndex) const
const TClass * modelType() const
REGISTER_FWITEMACCESSOR_METHODS()
FWItemRangeAccessor(const TClass *iClass)