CMS 3D CMS Logo

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

#include <Fireworks/Core/interface/FWItemTVirtualCollectionProxyAccessor.h>

Inheritance diagram for FWItemTVirtualCollectionProxyAccessor:
FWItemAccessorBase

Public Member Functions

const void * data () const override
 
 FWItemTVirtualCollectionProxyAccessor (const TClass *iType, std::shared_ptr< TVirtualCollectionProxy > iProxy, size_t iOffset=0)
 
 FWItemTVirtualCollectionProxyAccessor (const FWItemTVirtualCollectionProxyAccessor &)=delete
 
bool isCollection () const override
 
const void * modelData (int iIndex) const override
 
const TClass * modelType () const override
 
const FWItemTVirtualCollectionProxyAccessoroperator= (const FWItemTVirtualCollectionProxyAccessor &)=delete
 
void reset () override
 
void setData (const edm::ObjectWithDict &) override
 override if id of an object should be different than the index More...
 
unsigned int size () const override
 
const TClass * type () const override
 
 ~FWItemTVirtualCollectionProxyAccessor () override
 
- Public Member Functions inherited from FWItemAccessorBase
 FWItemAccessorBase ()
 
virtual ~FWItemAccessorBase ()
 

Private Attributes

std::shared_ptr< TVirtualCollectionProxy > m_colProxy
 
const void * m_data
 
size_t m_offset
 
const TClass * m_type
 

Detailed Description

Description: <one line="" class="" summary>="">

Usage: <usage>

Definition at line 30 of file FWItemTVirtualCollectionProxyAccessor.h.

Constructor & Destructor Documentation

◆ FWItemTVirtualCollectionProxyAccessor() [1/2]

FWItemTVirtualCollectionProxyAccessor::FWItemTVirtualCollectionProxyAccessor ( const TClass *  iType,
std::shared_ptr< TVirtualCollectionProxy >  iProxy,
size_t  iOffset = 0 
)

◆ ~FWItemTVirtualCollectionProxyAccessor()

FWItemTVirtualCollectionProxyAccessor::~FWItemTVirtualCollectionProxyAccessor ( )
override

Definition at line 42 of file FWItemTVirtualCollectionProxyAccessor.cc.

42 {}

◆ FWItemTVirtualCollectionProxyAccessor() [2/2]

FWItemTVirtualCollectionProxyAccessor::FWItemTVirtualCollectionProxyAccessor ( const FWItemTVirtualCollectionProxyAccessor )
delete

Member Function Documentation

◆ data()

const void * FWItemTVirtualCollectionProxyAccessor::data ( ) const
overridevirtual

◆ isCollection()

bool FWItemTVirtualCollectionProxyAccessor::isCollection ( ) const
overridevirtual

Implements FWItemAccessorBase.

Definition at line 100 of file FWItemTVirtualCollectionProxyAccessor.cc.

100 { return true; }

◆ modelData()

const void * FWItemTVirtualCollectionProxyAccessor::modelData ( int  iIndex) const
overridevirtual

Implements FWItemAccessorBase.

Definition at line 80 of file FWItemTVirtualCollectionProxyAccessor.cc.

References m_colProxy, and m_data.

80  {
81  if (nullptr == m_data) {
82  return m_data;
83  }
84  return m_colProxy->At(iIndex);
85 }
std::shared_ptr< TVirtualCollectionProxy > m_colProxy

◆ modelType()

const TClass * FWItemTVirtualCollectionProxyAccessor::modelType ( ) const
overridevirtual

Implements FWItemAccessorBase.

Definition at line 96 of file FWItemTVirtualCollectionProxyAccessor.cc.

References m_colProxy.

96 { return m_colProxy->GetValueClass(); }
std::shared_ptr< TVirtualCollectionProxy > m_colProxy

◆ operator=()

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

◆ reset()

void FWItemTVirtualCollectionProxyAccessor::reset ( void  )
overridevirtual

Implements FWItemAccessorBase.

Definition at line 70 of file FWItemTVirtualCollectionProxyAccessor.cc.

References m_colProxy, and m_data.

Referenced by setData().

70  {
71  if (nullptr != m_data) {
72  m_data = nullptr;
73  m_colProxy->PopProxy();
74  }
75 }
std::shared_ptr< TVirtualCollectionProxy > m_colProxy

◆ setData()

void FWItemTVirtualCollectionProxyAccessor::setData ( const edm::ObjectWithDict )
overridevirtual

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

Implements FWItemAccessorBase.

Definition at line 59 of file FWItemTVirtualCollectionProxyAccessor.cc.

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

59  {
60  if (product.address() == nullptr) {
61  reset();
62  return;
63  }
64 
65  m_data = product.address();
66  assert(nullptr != m_data);
67  m_colProxy->PushProxy(static_cast<char*>(const_cast<void*>(m_data)) + m_offset);
68 }
std::shared_ptr< TVirtualCollectionProxy > m_colProxy
assert(be >=bs)

◆ size()

unsigned int FWItemTVirtualCollectionProxyAccessor::size ( void  ) const
overridevirtual

Implements FWItemAccessorBase.

Definition at line 89 of file FWItemTVirtualCollectionProxyAccessor.cc.

References m_colProxy, and m_data.

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

89  {
90  if (m_data == nullptr) {
91  return 0;
92  }
93  return m_colProxy->Size();
94 }
std::shared_ptr< TVirtualCollectionProxy > m_colProxy

◆ type()

const TClass * FWItemTVirtualCollectionProxyAccessor::type ( ) const
overridevirtual

Implements FWItemAccessorBase.

Definition at line 98 of file FWItemTVirtualCollectionProxyAccessor.cc.

References m_type.

Member Data Documentation

◆ m_colProxy

std::shared_ptr<TVirtualCollectionProxy> FWItemTVirtualCollectionProxyAccessor::m_colProxy
private

Definition at line 60 of file FWItemTVirtualCollectionProxyAccessor.h.

Referenced by modelData(), modelType(), reset(), setData(), and size().

◆ m_data

const void* FWItemTVirtualCollectionProxyAccessor::m_data
mutableprivate

Definition at line 61 of file FWItemTVirtualCollectionProxyAccessor.h.

Referenced by data(), modelData(), reset(), setData(), and size().

◆ m_offset

size_t FWItemTVirtualCollectionProxyAccessor::m_offset
private

Definition at line 62 of file FWItemTVirtualCollectionProxyAccessor.h.

Referenced by setData().

◆ m_type

const TClass* FWItemTVirtualCollectionProxyAccessor::m_type
private

Definition at line 59 of file FWItemTVirtualCollectionProxyAccessor.h.

Referenced by type().