#include <FWItemRandomAccessor.h>
Public Types | |
typedef C | container_type |
typedef R | range_type |
typedef V | value_type |
Public Member Functions | |
FWItemRangeAccessor (const TClass *iClass) | |
const void * | modelData (int iIndex) const |
REGISTER_FWITEMACCESSOR_METHODS () | |
unsigned int | size () const |
Definition at line 190 of file FWItemRandomAccessor.h.
typedef C FWItemRangeAccessor< C, R, V >::container_type |
Definition at line 193 of file FWItemRandomAccessor.h.
typedef R FWItemRangeAccessor< C, R, V >::range_type |
Definition at line 194 of file FWItemRandomAccessor.h.
typedef V FWItemRangeAccessor< C, R, V >::value_type |
Definition at line 195 of file FWItemRandomAccessor.h.
FWItemRangeAccessor< C, R, V >::FWItemRangeAccessor | ( | const TClass * | iClass | ) | [inline] |
Definition at line 197 of file FWItemRandomAccessor.h.
: FWItemRandomAccessorBase(iClass, typeid(value_type)) {}
const void* FWItemRangeAccessor< C, R, V >::modelData | ( | int | iIndex | ) | const [inline, virtual] |
Implements FWItemAccessorBase.
Definition at line 203 of file FWItemRandomAccessor.h.
References trackerHits::c, FWItemRandomAccessorBase::getDataPtr(), and i.
{ if (!getDataPtr()) return 0; const container_type *c = reinterpret_cast<const container_type*>(getDataPtr()); size_t collectionOffset = 0; for (typename container_type::const_iterator ci = c->begin(), ce = c->end(); ci != ce; ++ci) { size_t i = iIndex - collectionOffset; if (i < std::distance(ci->first, ci->second)) return &(*(ci + i)); collectionOffset += ci->size(); } return 0; }
FWItemRangeAccessor< C, R, V >::REGISTER_FWITEMACCESSOR_METHODS | ( | ) |
unsigned int FWItemRangeAccessor< C, R, V >::size | ( | void | ) | const [inline, virtual] |
Implements FWItemAccessorBase.
Definition at line 220 of file FWItemRandomAccessor.h.
References trackerHits::c, and FWItemRandomAccessorBase::getDataPtr().
{ if (!getDataPtr()) return 0; const container_type *c = reinterpret_cast<const container_type*>(getDataPtr()); size_t finalSize = 0; for (typename range_type::const_iterator ci = c->begin(), ce = c->end(); ci != ce; ++ci) finalSize += std::distance(ci->first, ci->second); return finalSize; }