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>
89 return &(
reinterpret_cast<container_type *
>(
getDataPtr())->
operator[](iIndex));
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();
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));
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();
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);
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()
virtual ~FWItemRandomAccessorBase()
const TClass * type() const
FWItemDetSetAccessor(const TClass *iClass)
const void * data() const
const FWItemRandomAccessorBase & operator=(const FWItemRandomAccessorBase &)
bool isCollection() const
FWItemRandomAccessor(const TClass *iClass)
const void * modelData(int iIndex) const
unsigned int size() const
Container::value_type value_type
unsigned int size() const
const void * modelData(int iIndex) const
FWItemMuonDigiAccessor(const TClass *iClass)
FWItemRandomAccessorBase(const TClass *type, const std::type_info &modelTypeName)
const void * modelData(int iIndex) const
FWItemNewDetSetAccessor(const TClass *iClass)
void setData(const edm::ObjectWithDict &)
override if id of an object should be different than the index
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
virtual unsigned int size() const =0
FWItemRangeAccessor(const TClass *iClass)