1 #ifndef Fireworks_Core_FWItemRandomAccessor_h 2 #define Fireworks_Core_FWItemRandomAccessor_h 32 const void *
data()
const override;
33 const TClass *
type()
const override;
39 void reset()
override;
71 template <
class C,
class V =
typename C::value_type>
85 return &(
reinterpret_cast<container_type *
>(
getDataPtr())->
operator[](iIndex));
88 unsigned int size()
const override {
91 return reinterpret_cast<const container_type *
>(
getDataPtr())->
size();
102 template <
class C,
class COLL =
typename C::value_type,
class V =
typename COLL::value_type>
116 const container_type *
c =
reinterpret_cast<const container_type *
>(
getDataPtr());
117 size_t collectionOffset = 0;
118 for (
typename container_type::const_iterator ci = c->begin(), ce = c->end(); ci != ce; ++ci) {
119 size_t i = iIndex - collectionOffset;
121 return &(ci->operator[](i));
122 collectionOffset += ci->size();
128 unsigned int size()
const override {
131 const container_type *
c =
reinterpret_cast<const container_type *
>(
getDataPtr());
132 size_t finalSize = 0;
134 for (
typename container_type::const_iterator
i = c->begin(),
e = c->end();
i !=
e; ++
i)
135 finalSize +=
i->size();
143 template <
class C,
class COLL =
typename C::value_type,
class V =
typename COLL::value_type>
157 const container_type *
c =
reinterpret_cast<const container_type *
>(
getDataPtr());
161 return &(c->data().operator[](iIndex));
164 unsigned int size()
const override {
167 const container_type *
c =
reinterpret_cast<const container_type *
>(
getDataPtr());
168 return c->dataSize();
172 template <
class C,
class R =
typename C::Range,
class V =
typename R::value_type>
186 const container_type *
c =
reinterpret_cast<const container_type *
>(
getDataPtr());
187 size_t collectionOffset = 0;
188 for (
typename container_type::const_iterator ci = c->begin(), ce = c->end(); ci != ce; ++ci) {
189 size_t i = iIndex - collectionOffset;
192 collectionOffset += ci->size();
198 unsigned int size()
const override {
201 const container_type *
c =
reinterpret_cast<const container_type *
>(
getDataPtr());
202 size_t finalSize = 0;
204 for (
typename range_type::const_iterator ci = c->begin(), ce = c->end(); ci != ce; ++ci)
211 template <
class C,
class V>
224 const container_type *
c =
reinterpret_cast<const container_type *
>(
getDataPtr());
225 size_t collectionOffset = 0;
227 for (
typename container_type::DigiRangeIterator ci = c->begin(), ce = c->end(); ci != ce; ++ci) {
228 int i = iIndex - collectionOffset;
233 return &(*(vt.second.first + i));
234 collectionOffset +=
std::distance(vt.second.first, vt.second.second);
240 unsigned int size()
const override {
243 const container_type *
c =
reinterpret_cast<const container_type *
>(
getDataPtr());
244 size_t finalSize = 0;
246 for (
typename container_type::DigiRangeIterator ci = c->begin(), ce = c->end(); ci != ce; ++ci) {
248 finalSize +=
std::distance(vt.second.first, vt.second.second);
268 const container_type *
c =
reinterpret_cast<const container_type *
>(
getDataPtr());
270 return &(c->at(0, iIndex));
273 unsigned int size()
const override {
277 const container_type *
c =
reinterpret_cast<const container_type *
>(
getDataPtr());
const TClass * type() const override
const void * modelData(int iIndex) const override
const TClass * modelType() const override
FWItemDetSetAccessor(const TClass *iClass)
unsigned int size() const override
const void * modelData(int iIndex) const override
const FWItemRandomAccessorBase & operator=(const FWItemRandomAccessorBase &)=delete
FWItemRandomAccessor(const TClass *iClass)
const void * modelData(int iIndex) const override
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)
#define REGISTER_FWITEMACCESSOR_METHODS()
FWItemNewDetSetAccessor(const TClass *iClass)
unsigned int size() const override
BXVectorAccessor(const TClass *iClass)
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)