1 #ifndef Fireworks_Core_FWItemRandomAccessor_h 2 #define Fireworks_Core_FWItemRandomAccessor_h 33 const void*
data()
const override;
34 const TClass*
type()
const override;
40 void reset()
override;
72 template <
class C,
class V =
typename C::value_type>
89 return &(
reinterpret_cast<container_type *
>(
getDataPtr())->
operator[](iIndex));
92 unsigned int size()
const override 96 return reinterpret_cast<const container_type*
>(
getDataPtr())->
size();
107 template <
class C,
class COLL =
typename C::value_type,
class V =
typename COLL::value_type >
125 const container_type *
c =
reinterpret_cast<const container_type*
>(
getDataPtr());
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();
138 unsigned int size()
const override 142 const container_type *
c =
reinterpret_cast<const container_type*
>(
getDataPtr());
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 >
172 const container_type *
c =
reinterpret_cast<const container_type*
>(
getDataPtr());
176 return &(c->data().operator[](iIndex));
179 unsigned int size()
const override 183 const container_type *
c =
reinterpret_cast<const container_type*
>(
getDataPtr());
184 return c->dataSize();
188 template <
class C,
class R =
typename C::Range,
class V =
typename R::value_type>
206 const container_type *
c =
reinterpret_cast<const container_type*
>(
getDataPtr());
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;
213 collectionOffset += ci->size();
219 unsigned int size()
const override 223 const container_type *
c =
reinterpret_cast<const container_type*
>(
getDataPtr());
224 size_t finalSize = 0;
226 for (
typename range_type::const_iterator ci = c->begin(), ce = c->end(); ci != ce; ++ci)
233 template <
class C,
class V>
250 const container_type *
c =
reinterpret_cast<const container_type*
>(
getDataPtr());
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;
261 return &(*(vt.second.first + i));
262 collectionOffset +=
std::distance(vt.second.first, vt.second.second);
268 unsigned int size()
const override 272 const container_type *
c =
reinterpret_cast<const container_type*
>(
getDataPtr());
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);
#define REGISTER_FWITEMACCESSOR_METHODS()
const TClass * type() const override
const void * modelData(int iIndex) const override
const TClass * modelType() const override
FWItemDetSetAccessor(const TClass *iClass)
const void * modelData(int iIndex) const override
const FWItemRandomAccessorBase & operator=(const FWItemRandomAccessorBase &)=delete
FWItemRandomAccessor(const TClass *iClass)
Container::value_type value_type
const void * modelData(int iIndex) const override
const void * modelData(int iIndex) const override
const void * data() const override
FWItemMuonDigiAccessor(const TClass *iClass)
unsigned int size() const override
FWItemRandomAccessorBase(const TClass *type, const std::type_info &modelTypeName)
FWItemNewDetSetAccessor(const TClass *iClass)
unsigned int size() const override
const TClass * m_modelType
unsigned int size() const override
unsigned int size() const override
unsigned int size() const override
~FWItemRandomAccessorBase() override
void * getDataPtr() const
void setData(const edm::ObjectWithDict &) override
override if id of an object should be different than the index
const void * modelData(int iIndex) const override
bool isCollection() const override
virtual unsigned int size() const =0
FWItemRangeAccessor(const TClass *iClass)