CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions
FWItemRandomAccessorBase Class Reference

#include <FWItemRandomAccessor.h>

Inheritance diagram for FWItemRandomAccessorBase:
FWItemAccessorBase BXVectorAccessor< C > FWItemDetSetAccessor< C, COLL, V > FWItemMuonDigiAccessor< C, V > FWItemNewDetSetAccessor< C, COLL, V > FWItemRandomAccessor< C, V > FWItemRangeAccessor< C, R, V >

Public Member Functions

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 const void * modelData (int iIndex) const =0
 
virtual unsigned int size () const =0
 
virtual ~FWItemAccessorBase ()
 

Protected Member Functions

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

Protected Attributes

void * m_data
 
const TClass * m_modelType
 
const TClass * m_type
 

Private Member Functions

 FWItemRandomAccessorBase (const FWItemRandomAccessorBase &)=delete
 
const FWItemRandomAccessorBaseoperator= (const FWItemRandomAccessorBase &)=delete
 

Detailed Description

Non templated part of the generic FWItemRandomAccessor<T> class.

Notice that the constructor is protected, so that it is impossible to instanciate this baseclass directly.

Definition at line 28 of file FWItemRandomAccessor.h.

Constructor & Destructor Documentation

FWItemRandomAccessorBase::~FWItemRandomAccessorBase ( )
override

Definition at line 32 of file FWItemRandomAccessor.cc.

32 {}
FWItemRandomAccessorBase::FWItemRandomAccessorBase ( const TClass *  type,
const std::type_info &  modelTypeName 
)
protected

Definition at line 24 of file FWItemRandomAccessor.cc.

25  : m_type(type), m_modelType(TClass::GetClass(modelTypeName)), m_data(nullptr) {}
type
Definition: HCALResponse.h:21
FWItemRandomAccessorBase::FWItemRandomAccessorBase ( const FWItemRandomAccessorBase )
privatedelete

Member Function Documentation

const void * FWItemRandomAccessorBase::data ( ) const
overridevirtual

Implements FWItemAccessorBase.

Definition at line 64 of file FWItemRandomAccessor.cc.

References m_data.

64 { return m_data; }
void * FWItemRandomAccessorBase::getDataPtr ( ) const
protected
bool FWItemRandomAccessorBase::isCollection ( ) const
overridevirtual

Implements FWItemAccessorBase.

Definition at line 75 of file FWItemRandomAccessor.cc.

75 { return true; }
const TClass * FWItemRandomAccessorBase::modelType ( ) const
overridevirtual

Implements FWItemAccessorBase.

Definition at line 70 of file FWItemRandomAccessor.cc.

References m_modelType.

70  {
71  assert(m_modelType);
72  return m_modelType;
73 }
const FWItemRandomAccessorBase& FWItemRandomAccessorBase::operator= ( const FWItemRandomAccessorBase )
privatedelete
void FWItemRandomAccessorBase::reset ( void  )
overridevirtual

Implements FWItemAccessorBase.

Definition at line 59 of file FWItemRandomAccessor.cc.

References m_data.

Referenced by setData().

59 { m_data = nullptr; }
void FWItemRandomAccessorBase::setData ( const edm::ObjectWithDict )
overridevirtual

override if id of an object should be different than the index

Implements FWItemAccessorBase.

Definition at line 49 of file FWItemRandomAccessor.cc.

References edm::ObjectWithDict::address(), m_data, and reset().

49  {
50  if (product.address() == nullptr) {
51  reset();
52  return;
53  }
54 
55  m_data = product.address();
56  assert(nullptr != m_data);
57 }
const TClass * FWItemRandomAccessorBase::type ( ) const
overridevirtual

Member Data Documentation

void* FWItemRandomAccessorBase::m_data
mutableprotected

Definition at line 46 of file FWItemRandomAccessor.h.

Referenced by data(), getDataPtr(), reset(), and setData().

const TClass* FWItemRandomAccessorBase::m_modelType
protected

Definition at line 45 of file FWItemRandomAccessor.h.

Referenced by modelType().

const TClass* FWItemRandomAccessorBase::m_type
protected

Definition at line 44 of file FWItemRandomAccessor.h.

Referenced by type().