1 #ifndef Fireworks_Core_FWItemRandomAccessor_h
2 #define Fireworks_Core_FWItemRandomAccessor_h
14 #include "Reflex/Object.h"
34 const void*
data()
const;
35 const TClass*
type()
const;
40 void setData(
const ROOT::Reflex::Object&);
73 template <
class C,
class V =
typename C::value_type>
108 template <
class C,
class COLL =
typename C::value_type,
class V =
typename COLL::value_type >
127 size_t collectionOffset = 0;
128 for (
typename container_type::const_iterator ci = c->begin(), ce = c->end(); ci != ce; ++ci)
130 size_t i = iIndex - collectionOffset;
132 return &(ci->operator[](i));
133 collectionOffset += ci->size();
144 size_t finalSize = 0;
146 for (
typename container_type::const_iterator
i = c->begin(), e = c->end();
i != e; ++
i)
147 finalSize +=
i->size();
155 template <
class C,
class COLL =
typename C::value_type,
class V =
typename COLL::value_type >
177 return &(c->data().operator[](iIndex));
185 return c->dataSize();
189 template <
class C,
class R =
typename C::Range,
class V =
typename R::value_type>
208 size_t collectionOffset = 0;
209 for (
typename container_type::const_iterator ci = c->begin(), ce = c->end(); ci != ce; ++ci)
211 size_t i = iIndex - collectionOffset;
212 if (i < std::distance(ci->first, ci->second))
214 collectionOffset += ci->size();
225 size_t finalSize = 0;
227 for (
typename range_type::const_iterator ci = c->begin(), ce = c->end(); ci != ce; ++ci)
228 finalSize += std::distance(ci->first, ci->second);
234 template <
class C,
class V>
252 size_t collectionOffset = 0;
254 for (
typename container_type::DigiRangeIterator ci = c->begin(), ce = c->end(); ci != ce; ++ci)
256 int i = iIndex - collectionOffset;
261 if (i < std::distance(vt.second.first, vt.second.second))
262 return &(*(vt.second.first + i));
263 collectionOffset += std::distance(vt.second.first, vt.second.second);
274 size_t finalSize = 0;
276 for (
typename container_type::DigiRangeIterator ci = c->begin(), ce = c->end(); ci != ce; ++ci)
279 finalSize += std::distance(vt.second.first, vt.second.second);
virtual ~FWItemRandomAccessorBase()
const TClass * type() const
void setData(const ROOT::Reflex::Object &)
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)
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)