#include <FWItemRandomAccessor.h>
Public Member Functions | |
FWItemRandomAccessor (const TClass *iClass) | |
const void * | modelData (int iIndex) const |
REGISTER_FWITEMACCESSOR_METHODS () | |
unsigned int | size () const |
Private Types | |
typedef C | container_type |
typedef V | container_value_type |
A generic helper class which can be used to create a specialized FWItemAccessorBase plugin for all the classes that expose a std::vector like interface.
The template argument T is the actual type of the container you want to have an accessor for and it must satisty the following:
Notice that most of the work is actually done by the baseclass.
Definition at line 74 of file FWItemRandomAccessor.h.
typedef C FWItemRandomAccessor< C, V >::container_type [private] |
Definition at line 76 of file FWItemRandomAccessor.h.
typedef V FWItemRandomAccessor< C, V >::container_value_type [private] |
Definition at line 77 of file FWItemRandomAccessor.h.
FWItemRandomAccessor< C, V >::FWItemRandomAccessor | ( | const TClass * | iClass | ) | [inline] |
Definition at line 79 of file FWItemRandomAccessor.h.
: FWItemRandomAccessorBase(iClass, typeid(container_value_type)) {}
const void* FWItemRandomAccessor< C, V >::modelData | ( | int | iIndex | ) | const [inline, virtual] |
Implements FWItemAccessorBase.
Definition at line 86 of file FWItemRandomAccessor.h.
References FWItemRandomAccessorBase::getDataPtr().
{ if (!getDataPtr()) return 0; return &(reinterpret_cast<container_type *>(getDataPtr())->operator[](iIndex)); }
FWItemRandomAccessor< C, V >::REGISTER_FWITEMACCESSOR_METHODS | ( | ) |
unsigned int FWItemRandomAccessor< C, V >::size | ( | void | ) | const [inline, virtual] |
Implements FWItemAccessorBase.
Definition at line 93 of file FWItemRandomAccessor.h.
References FWItemRandomAccessorBase::getDataPtr().
{ if (!getDataPtr()) return 0; return reinterpret_cast<const container_type*>(getDataPtr())->size(); }