CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Protected Attributes
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
 
 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 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
 

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 )
delete

Member Function Documentation

◆ data()

const void * FWItemRandomAccessorBase::data ( ) const
overridevirtual

Implements FWItemAccessorBase.

Definition at line 64 of file FWItemRandomAccessor.cc.

References m_data.

64 { return 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.

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

70  {
72  return m_modelType;
73 }
assert(be >=bs)

◆ operator=()

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

◆ reset()

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; }

◆ 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.

References edm::ObjectWithDict::address(), cms::cuda::assert(), 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 }
assert(be >=bs)

◆ type()

const TClass * FWItemRandomAccessorBase::type ( ) const
overridevirtual

Implements FWItemAccessorBase.

Definition at line 68 of file FWItemRandomAccessor.cc.

References m_type.

68 { return 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().