CMS 3D CMS Logo

Public Member Functions | Private Types

FWItemRandomAccessor< C, V > Class Template Reference

#include <FWItemRandomAccessor.h>

Inheritance diagram for FWItemRandomAccessor< C, V >:
FWItemRandomAccessorBase FWItemAccessorBase

List of all members.

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

Detailed Description

template<class C, class V = typename C::value_type>
class FWItemRandomAccessor< C, V >

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.


Member Typedef Documentation

template<class C , class V = typename C::value_type>
typedef C FWItemRandomAccessor< C, V >::container_type [private]

Definition at line 76 of file FWItemRandomAccessor.h.

template<class C , class V = typename C::value_type>
typedef V FWItemRandomAccessor< C, V >::container_value_type [private]

Definition at line 77 of file FWItemRandomAccessor.h.


Constructor & Destructor Documentation

template<class C , class V = typename C::value_type>
FWItemRandomAccessor< C, V >::FWItemRandomAccessor ( const TClass *  iClass) [inline]

Definition at line 79 of file FWItemRandomAccessor.h.


Member Function Documentation

template<class C , class V = typename C::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));
      }
template<class C , class V = typename C::value_type>
FWItemRandomAccessor< C, V >::REGISTER_FWITEMACCESSOR_METHODS ( )
template<class C , class V = typename C::value_type>
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();
      }