CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Static 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

template<>
const std::string & classPurpose ()
 
template<>
const std::string & classPurpose ()
 
template<>
const std::string & classPurpose ()
 
template<>
const std::string & classPurpose ()
 
template<>
const std::string & classPurpose ()
 
template<>
const std::string & classPurpose ()
 
template<>
const std::string & classPurpose ()
 
template<>
const std::string & classPurpose ()
 
template<>
const std::string & classPurpose ()
 
template<>
const std::string & classPurpose ()
 
template<>
const std::string & classRegisterTypeName ()
 
template<>
const std::string & classRegisterTypeName ()
 
template<>
const std::string & classRegisterTypeName ()
 
template<>
const std::string & classRegisterTypeName ()
 
template<>
const std::string & classRegisterTypeName ()
 
template<>
const std::string & classRegisterTypeName ()
 
template<>
const std::string & classRegisterTypeName ()
 
template<>
const std::string & classRegisterTypeName ()
 
template<>
const std::string & classRegisterTypeName ()
 
template<>
const std::string & classRegisterTypeName ()
 
template<>
const std::string & classTypeName ()
 
template<>
const std::string & classTypeName ()
 
template<>
const std::string & classTypeName ()
 
template<>
const std::string & classTypeName ()
 
template<>
const std::string & classTypeName ()
 
template<>
const std::string & classTypeName ()
 
template<>
const std::string & classTypeName ()
 
template<>
const std::string & classTypeName ()
 
template<>
const std::string & classTypeName ()
 
template<>
const std::string & classTypeName ()
 
 FWItemRandomAccessor (const TClass *iClass)
 
const void * modelData (int iIndex) const override
 
const std::string & purpose () const
 
unsigned int size () const override
 
const std::string & typeName () const
 
- Public Member Functions inherited from FWItemRandomAccessorBase
const void * data () const override
 
 FWItemRandomAccessorBase (const FWItemRandomAccessorBase &)=delete
 
bool isCollection () const override
 
const TClass * modelType () const override
 
const FWItemRandomAccessorBaseoperator= (const FWItemRandomAccessorBase &)=delete
 
void reset () override
 
void setData (const edm::ObjectWithDict &) override
 override if id of an object should be different than the index More...
 
const TClass * type () const override
 
 ~FWItemRandomAccessorBase () override
 
- Public Member Functions inherited from FWItemAccessorBase
 FWItemAccessorBase ()
 
virtual ~FWItemAccessorBase ()
 

Static Public Member Functions

static const std::string & classPurpose ()
 
static const std::string & classRegisterTypeName ()
 
static const std::string & classTypeName ()
 

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 std::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 72 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 73 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 74 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 77 of file FWItemRandomAccessor.h.

FWItemRandomAccessorBase(const TClass *type, const std::type_info &modelTypeName)

Member Function Documentation

template<>
const std::string & FWItemRandomAccessor< CSCRecHit2DCollection >::classPurpose ( )

Definition at line 46 of file FWItemMuonAccessors.cc.

template<>
const std::string & FWItemRandomAccessor< CSCSegmentCollection >::classPurpose ( )

Definition at line 49 of file FWItemMuonAccessors.cc.

template<>
const std::string & FWItemRandomAccessor< DTRecSegment2DCollection >::classPurpose ( )

Definition at line 52 of file FWItemMuonAccessors.cc.

template<>
const std::string & FWItemRandomAccessor< DTRecSegment4DCollection >::classPurpose ( )

Definition at line 55 of file FWItemMuonAccessors.cc.

template<>
const std::string & FWItemRandomAccessor< DTRecHitCollection >::classPurpose ( )

Definition at line 58 of file FWItemMuonAccessors.cc.

template<>
const std::string & FWItemRandomAccessor< RPCRecHitCollection >::classPurpose ( )

Definition at line 61 of file FWItemMuonAccessors.cc.

template<>
const std::string & FWItemRandomAccessor< GEMRecHitCollection >::classPurpose ( )

Definition at line 64 of file FWItemMuonAccessors.cc.

template<>
const std::string & FWItemRandomAccessor< GEMSegmentCollection >::classPurpose ( )

Definition at line 67 of file FWItemMuonAccessors.cc.

template<>
const std::string & FWItemRandomAccessor< ME0RecHitCollection >::classPurpose ( )

Definition at line 70 of file FWItemMuonAccessors.cc.

template<>
const std::string & FWItemRandomAccessor< ME0SegmentCollection >::classPurpose ( )

Definition at line 73 of file FWItemMuonAccessors.cc.

template<class C , class V = typename C::value_type>
static const std::string& FWItemRandomAccessor< C, V >::classPurpose ( )
static
template<>
const std::string & FWItemRandomAccessor< CSCRecHit2DCollection >::classRegisterTypeName ( )

Definition at line 46 of file FWItemMuonAccessors.cc.

template<>
const std::string & FWItemRandomAccessor< CSCSegmentCollection >::classRegisterTypeName ( )

Definition at line 49 of file FWItemMuonAccessors.cc.

template<>
const std::string & FWItemRandomAccessor< DTRecSegment2DCollection >::classRegisterTypeName ( )

Definition at line 52 of file FWItemMuonAccessors.cc.

template<>
const std::string & FWItemRandomAccessor< DTRecSegment4DCollection >::classRegisterTypeName ( )

Definition at line 55 of file FWItemMuonAccessors.cc.

template<>
const std::string & FWItemRandomAccessor< DTRecHitCollection >::classRegisterTypeName ( )

Definition at line 58 of file FWItemMuonAccessors.cc.

template<>
const std::string & FWItemRandomAccessor< RPCRecHitCollection >::classRegisterTypeName ( )

Definition at line 61 of file FWItemMuonAccessors.cc.

template<>
const std::string & FWItemRandomAccessor< GEMRecHitCollection >::classRegisterTypeName ( )

Definition at line 64 of file FWItemMuonAccessors.cc.

template<>
const std::string & FWItemRandomAccessor< GEMSegmentCollection >::classRegisterTypeName ( )

Definition at line 67 of file FWItemMuonAccessors.cc.

template<>
const std::string & FWItemRandomAccessor< ME0RecHitCollection >::classRegisterTypeName ( )

Definition at line 70 of file FWItemMuonAccessors.cc.

template<>
const std::string & FWItemRandomAccessor< ME0SegmentCollection >::classRegisterTypeName ( )

Definition at line 73 of file FWItemMuonAccessors.cc.

template<class C , class V = typename C::value_type>
static const std::string& FWItemRandomAccessor< C, V >::classRegisterTypeName ( )
static
template<>
const std::string & FWItemRandomAccessor< CSCRecHit2DCollection >::classTypeName ( )

Definition at line 46 of file FWItemMuonAccessors.cc.

template<>
const std::string & FWItemRandomAccessor< CSCSegmentCollection >::classTypeName ( )

Definition at line 49 of file FWItemMuonAccessors.cc.

template<>
const std::string & FWItemRandomAccessor< DTRecSegment2DCollection >::classTypeName ( )

Definition at line 52 of file FWItemMuonAccessors.cc.

template<>
const std::string & FWItemRandomAccessor< DTRecSegment4DCollection >::classTypeName ( )

Definition at line 55 of file FWItemMuonAccessors.cc.

template<>
const std::string & FWItemRandomAccessor< DTRecHitCollection >::classTypeName ( )

Definition at line 58 of file FWItemMuonAccessors.cc.

template<>
const std::string & FWItemRandomAccessor< RPCRecHitCollection >::classTypeName ( )

Definition at line 61 of file FWItemMuonAccessors.cc.

template<>
const std::string & FWItemRandomAccessor< GEMRecHitCollection >::classTypeName ( )

Definition at line 64 of file FWItemMuonAccessors.cc.

template<>
const std::string & FWItemRandomAccessor< GEMSegmentCollection >::classTypeName ( )

Definition at line 67 of file FWItemMuonAccessors.cc.

template<>
const std::string & FWItemRandomAccessor< ME0RecHitCollection >::classTypeName ( )

Definition at line 70 of file FWItemMuonAccessors.cc.

template<>
const std::string & FWItemRandomAccessor< ME0SegmentCollection >::classTypeName ( )

Definition at line 73 of file FWItemMuonAccessors.cc.

template<class C , class V = typename C::value_type>
static const std::string& FWItemRandomAccessor< C, V >::classTypeName ( )
static
template<class C , class V = typename C::value_type>
const void* FWItemRandomAccessor< C, V >::modelData ( int  iIndex) const
inlineoverridevirtual

Implements FWItemAccessorBase.

Definition at line 82 of file FWItemRandomAccessor.h.

References FWItemRandomAccessorBase::getDataPtr().

82  {
83  if (!getDataPtr())
84  return nullptr;
85  return &(reinterpret_cast<container_type *>(getDataPtr())->operator[](iIndex));
86  }
template<class C , class V = typename C::value_type>
const std::string& FWItemRandomAccessor< C, V >::purpose ( ) const
inline

Definition at line 79 of file FWItemRandomAccessor.h.

82 {
template<class C , class V = typename C::value_type>
unsigned int FWItemRandomAccessor< C, V >::size ( void  ) const
inlineoverridevirtual

Implements FWItemAccessorBase.

Definition at line 88 of file FWItemRandomAccessor.h.

References FWItemRandomAccessorBase::getDataPtr().

Referenced by ntupleDataFormat._Collection::__iter__(), and ntupleDataFormat._Collection::__len__().

88  {
89  if (!getDataPtr())
90  return 0;
91  return reinterpret_cast<const container_type *>(getDataPtr())->size();
92  }
unsigned int size() const override
template<class C , class V = typename C::value_type>
const std::string& FWItemRandomAccessor< C, V >::typeName ( ) const
inline

Definition at line 79 of file FWItemRandomAccessor.h.

82 {