CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Types
FWItemRandomAccessor< C, V > Class Template Reference

#include <FWItemRandomAccessor.h>

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

Public Member Functions

 FWItemRandomAccessor (const TClass *iClass)
 
const void * modelData (int iIndex) const
 
 REGISTER_FWITEMACCESSOR_METHODS ()
 
unsigned int size () const
 
- Public Member Functions inherited from FWItemRandomAccessorBase
const void * data () const
 
bool isCollection () const
 
const TClass * modelType () const
 
virtual void reset ()
 
void setData (const edm::ObjectWithDict &)
 override if id of an object should be different than the index More...
 
const TClass * type () const
 
virtual ~FWItemRandomAccessorBase ()
 
- Public Member Functions inherited from FWItemAccessorBase
 FWItemAccessorBase ()
 
virtual ~FWItemAccessorBase ()
 

Private Types

typedef C container_type
 
typedef V container_value_type
 

Additional Inherited Members

- Protected Member Functions inherited from FWItemRandomAccessorBase
 FWItemRandomAccessorBase (const TClass *type, const type_info &modelTypeName)
 
void * getDataPtr () const
 
- Protected Attributes inherited from FWItemRandomAccessorBase
void * m_data
 
const TClass * m_modelType
 
const TClass * m_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.

81  {}
FWItemRandomAccessorBase(const TClass *type, const type_info &modelTypeName)

Member Function Documentation

template<class C , class V = typename C::value_type>
const void* FWItemRandomAccessor< C, V >::modelData ( int  iIndex) const
inlinevirtual

Implements FWItemAccessorBase.

Definition at line 86 of file FWItemRandomAccessor.h.

References FWItemRandomAccessorBase::getDataPtr().

87  {
88  if (!getDataPtr())
89  return 0;
90  return &(reinterpret_cast<container_type *>(getDataPtr())->operator[](iIndex));
91  }
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
inlinevirtual

Implements FWItemAccessorBase.

Definition at line 93 of file FWItemRandomAccessor.h.

References FWItemRandomAccessorBase::getDataPtr().

94  {
95  if (!getDataPtr())
96  return 0;
97  return reinterpret_cast<const container_type*>(getDataPtr())->size();
98  }
unsigned int size() const