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::~FWItemRandomAccessorBase ( )
override

Definition at line 32 of file FWItemRandomAccessor.cc.

32 {}

◆ FWItemRandomAccessorBase() [1/2]

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) {}

◆ FWItemRandomAccessorBase() [2/2]

FWItemRandomAccessorBase::FWItemRandomAccessorBase ( const FWItemRandomAccessorBase )
privatedelete

Member Function Documentation

◆ data()

const void * FWItemRandomAccessorBase::data ( ) const
overridevirtual

Implements FWItemAccessorBase.

Definition at line 64 of file FWItemRandomAccessor.cc.

64 { return m_data; }

References m_data.

◆ getDataPtr()

void * FWItemRandomAccessorBase::getDataPtr ( ) const
protected

◆ isCollection()

bool FWItemRandomAccessorBase::isCollection ( ) const
overridevirtual

Implements FWItemAccessorBase.

Definition at line 75 of file FWItemRandomAccessor.cc.

75 { return true; }

◆ modelType()

const TClass * FWItemRandomAccessorBase::modelType ( ) const
overridevirtual

Implements FWItemAccessorBase.

Definition at line 70 of file FWItemRandomAccessor.cc.

70  {
72  return m_modelType;
73 }

References cms::cuda::assert(), and m_modelType.

◆ operator=()

const FWItemRandomAccessorBase& FWItemRandomAccessorBase::operator= ( const FWItemRandomAccessorBase )
privatedelete

◆ reset()

void FWItemRandomAccessorBase::reset ( void  )
overridevirtual

Implements FWItemAccessorBase.

Definition at line 59 of file FWItemRandomAccessor.cc.

59 { m_data = nullptr; }

References m_data.

Referenced by setData().

◆ setData()

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.

49  {
50  if (product.address() == nullptr) {
51  reset();
52  return;
53  }
54 
55  m_data = product.address();
56  assert(nullptr != m_data);
57 }

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

◆ type()

const TClass * FWItemRandomAccessorBase::type ( ) const
overridevirtual

Implements FWItemAccessorBase.

Definition at line 68 of file FWItemRandomAccessor.cc.

68 { return m_type; }

References m_type.

Member Data Documentation

◆ m_data

void* FWItemRandomAccessorBase::m_data
mutableprotected

Definition at line 46 of file FWItemRandomAccessor.h.

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

◆ m_modelType

const TClass* FWItemRandomAccessorBase::m_modelType
protected

Definition at line 45 of file FWItemRandomAccessor.h.

Referenced by modelType().

◆ m_type

const TClass* FWItemRandomAccessorBase::m_type
protected

Definition at line 44 of file FWItemRandomAccessor.h.

Referenced by type().

FWItemRandomAccessorBase::m_data
void * m_data
Definition: FWItemRandomAccessor.h:46
cms::cuda::assert
assert(be >=bs)
type
type
Definition: SiPixelVCal_PayloadInspector.cc:39
FWItemRandomAccessorBase::reset
void reset() override
Definition: FWItemRandomAccessor.cc:59
FWItemRandomAccessorBase::m_type
const TClass * m_type
Definition: FWItemRandomAccessor.h:44
FWItemRandomAccessorBase::m_modelType
const TClass * m_modelType
Definition: FWItemRandomAccessor.h:45