CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules 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
 
bool isCollection () const override
 
const TClass * modelType () const override
 
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

◆ container_type

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.

◆ container_value_type

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

◆ FWItemRandomAccessor()

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.

Member Function Documentation

◆ classPurpose() [1/11]

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

Definition at line 46 of file FWItemMuonAccessors.cc.

◆ classPurpose() [2/11]

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

Definition at line 49 of file FWItemMuonAccessors.cc.

◆ classPurpose() [3/11]

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

Definition at line 52 of file FWItemMuonAccessors.cc.

◆ classPurpose() [4/11]

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

Definition at line 55 of file FWItemMuonAccessors.cc.

◆ classPurpose() [5/11]

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

Definition at line 58 of file FWItemMuonAccessors.cc.

◆ classPurpose() [6/11]

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

Definition at line 61 of file FWItemMuonAccessors.cc.

◆ classPurpose() [7/11]

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

Definition at line 64 of file FWItemMuonAccessors.cc.

◆ classPurpose() [8/11]

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

Definition at line 67 of file FWItemMuonAccessors.cc.

◆ classPurpose() [9/11]

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

Definition at line 70 of file FWItemMuonAccessors.cc.

◆ classPurpose() [10/11]

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

Definition at line 73 of file FWItemMuonAccessors.cc.

◆ classPurpose() [11/11]

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

◆ classRegisterTypeName() [1/11]

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

Definition at line 46 of file FWItemMuonAccessors.cc.

◆ classRegisterTypeName() [2/11]

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

Definition at line 49 of file FWItemMuonAccessors.cc.

◆ classRegisterTypeName() [3/11]

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

Definition at line 52 of file FWItemMuonAccessors.cc.

◆ classRegisterTypeName() [4/11]

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

Definition at line 55 of file FWItemMuonAccessors.cc.

◆ classRegisterTypeName() [5/11]

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

Definition at line 58 of file FWItemMuonAccessors.cc.

◆ classRegisterTypeName() [6/11]

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

Definition at line 61 of file FWItemMuonAccessors.cc.

◆ classRegisterTypeName() [7/11]

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

Definition at line 64 of file FWItemMuonAccessors.cc.

◆ classRegisterTypeName() [8/11]

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

Definition at line 67 of file FWItemMuonAccessors.cc.

◆ classRegisterTypeName() [9/11]

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

Definition at line 70 of file FWItemMuonAccessors.cc.

◆ classRegisterTypeName() [10/11]

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

Definition at line 73 of file FWItemMuonAccessors.cc.

◆ classRegisterTypeName() [11/11]

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

◆ classTypeName() [1/11]

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

Definition at line 46 of file FWItemMuonAccessors.cc.

◆ classTypeName() [2/11]

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

Definition at line 49 of file FWItemMuonAccessors.cc.

◆ classTypeName() [3/11]

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

Definition at line 52 of file FWItemMuonAccessors.cc.

◆ classTypeName() [4/11]

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

Definition at line 55 of file FWItemMuonAccessors.cc.

◆ classTypeName() [5/11]

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

Definition at line 58 of file FWItemMuonAccessors.cc.

◆ classTypeName() [6/11]

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

Definition at line 61 of file FWItemMuonAccessors.cc.

◆ classTypeName() [7/11]

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

Definition at line 64 of file FWItemMuonAccessors.cc.

◆ classTypeName() [8/11]

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

Definition at line 67 of file FWItemMuonAccessors.cc.

◆ classTypeName() [9/11]

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

Definition at line 70 of file FWItemMuonAccessors.cc.

◆ classTypeName() [10/11]

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

Definition at line 73 of file FWItemMuonAccessors.cc.

◆ classTypeName() [11/11]

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

◆ modelData()

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.

82  {
83  if (!getDataPtr())
84  return nullptr;
85  return &(reinterpret_cast<container_type *>(getDataPtr())->operator[](iIndex));
86  }

References FWItemRandomAccessorBase::getDataPtr().

◆ purpose()

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 {

◆ size()

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.

88  {
89  if (!getDataPtr())
90  return 0;
91  return reinterpret_cast<const container_type *>(getDataPtr())->size();
92  }

References FWItemRandomAccessorBase::getDataPtr().

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

◆ typeName()

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 {
FWItemRandomAccessor::container_value_type
V container_value_type
Definition: FWItemRandomAccessor.h:74
FWItemRandomAccessorBase::getDataPtr
void * getDataPtr() const
Definition: FWItemRandomAccessor.cc:66
FWItemRandomAccessorBase::FWItemRandomAccessorBase
FWItemRandomAccessorBase(const TClass *type, const std::type_info &modelTypeName)
Definition: FWItemRandomAccessor.cc:24