#include <FWItemRandomAccessor.h>
Public Types | |
typedef C | container_type |
typedef V | value_type |
Public Member Functions | |
FWItemMuonDigiAccessor (const TClass *iClass) | |
const void * | modelData (int iIndex) const |
REGISTER_FWITEMACCESSOR_METHODS () | |
unsigned int | size () const |
Definition at line 235 of file FWItemRandomAccessor.h.
typedef C FWItemMuonDigiAccessor< C, V >::container_type |
Definition at line 238 of file FWItemRandomAccessor.h.
typedef V FWItemMuonDigiAccessor< C, V >::value_type |
Definition at line 239 of file FWItemRandomAccessor.h.
FWItemMuonDigiAccessor< C, V >::FWItemMuonDigiAccessor | ( | const TClass * | iClass | ) | [inline] |
Definition at line 241 of file FWItemRandomAccessor.h.
: FWItemRandomAccessorBase(iClass, typeid(value_type)) {}
const void* FWItemMuonDigiAccessor< C, V >::modelData | ( | int | iIndex | ) | const [inline, virtual] |
Implements FWItemAccessorBase.
Definition at line 247 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::DigiRangeIterator ci = c->begin(), ce = c->end(); ci != ce; ++ci) { int i = iIndex - collectionOffset; typename container_type::DigiRangeIterator::value_type vt = *ci; if (i < std::distance(vt.second.first, vt.second.second)) return &(*(vt.second.first + i)); collectionOffset += std::distance(vt.second.first, vt.second.second); } return 0; }
FWItemMuonDigiAccessor< C, V >::REGISTER_FWITEMACCESSOR_METHODS | ( | ) |
unsigned int FWItemMuonDigiAccessor< C, V >::size | ( | void | ) | const [inline, virtual] |
Implements FWItemAccessorBase.
Definition at line 269 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 container_type::DigiRangeIterator ci = c->begin(), ce = c->end(); ci != ce; ++ci) { typename container_type::DigiRangeIterator::value_type vt = *ci; finalSize += std::distance(vt.second.first, vt.second.second); } return finalSize; }