ATLAS Offline Software
Loading...
Searching...
No Matches
SG::DVLConstDataVectorBucket< DV > Class Template Referenceabstract

DataBucket class for ConstDataVector. More...

#include <ConstDataVector.h>

Inheritance diagram for SG::DVLConstDataVectorBucket< DV >:
Collaboration diagram for SG::DVLConstDataVectorBucket< DV >:

Public Member Functions

 DVLConstDataVectorBucket (ConstDataVector< DV > *data)
 Constructor from a payload object.
 DVLConstDataVectorBucket (std::unique_ptr< ConstDataVector< DV > > data)
 Constructor from a payload object.
virtual void * cast (CLID clid, IRegisterTransient *irt=0, bool isConst=true) override
 Return the contents of the DataBucket, converted to type given by clid.
template<class T>
T * cast (SG::IRegisterTransient *irt=0, bool isConst=true)
 Return the contents of the DataBucket, converted to type T.
virtual void * cast (const std::type_info &tinfo, SG::IRegisterTransient *irt=0, bool isConst=true)=0
 Return the contents of the DataBucket, converted to type given by std::type_info.
virtual void * cast (CLID clid, const std::type_info &tinfo, SG::IRegisterTransient *irt=0, bool isConst=true)
 Return the contents of the DataBucket, converted to type given by clid.
virtual const CLIDclID () const override
 The CLID for the class of object we're holding.
virtual const std::type_info & tinfo () const override
 The std::type_info for the class of object we're holding.
virtual void * object () override
 operator DV * ()
 operator const DV * () const
virtual void relinquish () override
 Give up ownership of the DataBucket contents.
virtual void lock () override
 If the held object derives from ILockable, call lock() on it.

Static Public Member Functions

static const CLIDclassID ()

Protected Member Functions

DV * ptr ()
const DV * cptr () const
void * tryStaticConversion (CLID clid)
 Try a conversion using static SG_BASES information.

Private Types

typedef std::pair< DataModel_detail::DVLInfoBase *, void * > ent_t
typedef std::vector< ent_tvec_t

Private Attributes

vec_t m_copies
const std::type_info * m_ti
 The std::type_info for the class of object we're holding.
CLID m_clid
 The CLID for the class of object we're holding.
DV * m_ptr
vec_t m_cnvcopies

Detailed Description

template<class DV>
class SG::DVLConstDataVectorBucket< DV >

DataBucket class for ConstDataVector.

This is just the same as DVLDataBucket, except that we've got to convert the ConstDataVector to DataVector.

Note: Can be used to violate const-correctness. Don't use this yourself!

Definition at line 955 of file ConstDataVector.h.

Member Typedef Documentation

◆ ent_t

typedef std::pair<DataModel_detail::DVLInfoBase*, void*> SG::DVLDataBucket< DV >::ent_t
privateinherited

Definition at line 150 of file DVLDataBucket.h.

◆ vec_t

typedef std::vector<ent_t> SG::DVLDataBucket< DV >::vec_t
privateinherited

Definition at line 151 of file DVLDataBucket.h.

Constructor & Destructor Documentation

◆ DVLConstDataVectorBucket() [1/2]

template<class DV>
SG::DVLConstDataVectorBucket< DV >::DVLConstDataVectorBucket ( ConstDataVector< DV > * data)

Constructor from a payload object.

Parameters
dataObject to hold in the bucket.

◆ DVLConstDataVectorBucket() [2/2]

template<class DV>
SG::DVLConstDataVectorBucket< DV >::DVLConstDataVectorBucket ( std::unique_ptr< ConstDataVector< DV > > data)

Constructor from a payload object.

Parameters
dataObject to hold in the bucket.

Member Function Documentation

◆ cast() [1/4]

virtual void * DataBucketBase::cast ( CLID clid,
const std::type_info & tinfo,
SG::IRegisterTransient * irt = 0,
bool isConst = true )
virtualinherited

Return the contents of the DataBucket, converted to type given by clid.

Note that only derived->base conversions are allowed here.

Parameters
clidThe class ID to which to convert.
tinfoThe std::type_info of the type to which to convert.
irtTo be called if we make a new instance.
isConstTrue if the object being converted is regarded as const.

This allows the callee to choose whether to use clid or tinfo. By default, this uses type_info.

Reimplemented in Athena::DataBucketBranch, BareDataBucket, SG::DataBucket< T >, SG::DVLDataBucket< T >, SG::DVLDataBucket< U >, SG::MetaContDataBucket< T >, SG::MetaContDataBucket< U >, SG::PyDataBucket, SG::SymlinkDataObject, and xAODPrivate::HolderBucket.

◆ cast() [2/4]

virtual void * DataBucketBase::cast ( const std::type_info & tinfo,
SG::IRegisterTransient * irt = 0,
bool isConst = true )
pure virtualinherited

Return the contents of the DataBucket, converted to type given by std::type_info.

Note that only derived->base conversions are allowed here.

Parameters
tinfoThe std::type_info of the type to which to convert.
irtTo be called if we make a new instance.
isConstTrue if the object being converted is regarded as const.

Implemented in Athena::DataBucketBranch, BareDataBucket, SG::DataBucket< T >, SG::DVLDataBucket< T >, SG::DVLDataBucket< U >, SG::MetaContDataBucket< T >, SG::MetaContDataBucket< U >, SG::PyDataBucket, SG::SymlinkDataObject, and xAODPrivate::HolderBucket.

◆ cast() [3/4]

template<class T>
T * DataBucketBase::cast ( SG::IRegisterTransient * irt = 0,
bool isConst = true )
inherited

Return the contents of the DataBucket, converted to type T.

Note that only derived->base conversions are allowed here. T must have a valid Class ID for this to work.

Parameters
irtTo be called if we make a new instance.
isConstTrue if the object being converted is regarded as const.

◆ cast() [4/4]

virtual void * SG::DVLDataBucket< DV >::cast ( CLID clid,
IRegisterTransient * irt = 0,
bool isConst = true )
overridevirtualinherited

Return the contents of the DataBucket, converted to type given by clid.

Note that only derived->base conversions are allowed here.

Parameters
clidThe class ID to which to convert.
irtTo be called if we make a new instance.
isConstTrue if the object being converted is regarded as const.

Reimplemented from SG::DataBucket< DV >.

◆ classID()

const CLID & SG::DataBucket< DV >::classID ( )
staticinherited

◆ clID()

virtual const CLID & SG::DVLDataBucket< DV >::clID ( ) const
overridevirtualinherited

The CLID for the class of object we're holding.

May be different from that of the base DataVector in the case of a ViewVector.

Reimplemented from SG::DataBucket< DV >.

◆ cptr()

const DV * SG::DataBucket< DV >::cptr ( ) const
inlineprotectedinherited

Definition at line 131 of file DataBucket.h.

131{ return m_ptr; }

◆ lock()

virtual void SG::DataBucket< DV >::lock ( )
overridevirtualinherited

If the held object derives from ILockable, call lock() on it.

Implements DataBucketBase.

◆ object()

virtual void * SG::DataBucket< DV >::object ( )
inlineoverridevirtualinherited

Implements DataBucketBase.

Definition at line 49 of file DataBucket.h.

50 {
51 typedef typename std::remove_const<T>::type T_nc;
52 return const_cast<T_nc*>(m_ptr);
53 }

◆ operator const DV *()

SG::DataBucket< DV >::operator const DV * ( ) const
inlineinherited

Definition at line 72 of file DataBucket.h.

72{ return cptr(); }
const DV * cptr() const
Definition DataBucket.h:131

◆ operator DV *()

SG::DataBucket< DV >::operator DV* ( )
inlineinherited

Definition at line 71 of file DataBucket.h.

71{ return ptr(); } //FIXME can we do without?

◆ ptr()

DV * SG::DataBucket< DV >::ptr ( )
inlineprotectedinherited

Definition at line 130 of file DataBucket.h.

130{ return m_ptr; }

◆ relinquish()

virtual void SG::DataBucket< DV >::relinquish ( )
inlineoverridevirtualinherited

Give up ownership of the DataBucket contents.

This leaks the contents and it is useful mainly for error handling.

Implements DataBucketBase.

Definition at line 121 of file DataBucket.h.

121{ m_ptr=0;} //LEAKS m_ptr

◆ tinfo()

virtual const std::type_info & SG::DVLDataBucket< DV >::tinfo ( ) const
overridevirtualinherited

The std::type_info for the class of object we're holding.

May be different from that of the base DataVector in the case of a ViewVector.

Reimplemented from SG::DataBucket< DV >.

◆ tryStaticConversion()

void * SG::DataBucket< DV >::tryStaticConversion ( CLID clid)
protectedinherited

Try a conversion using static SG_BASES information.

Parameters
clidThe class ID to which to convert.

This can all be unfolded at compile time, so is fast, but doesn't take into account SG_ADD_BASES.

Member Data Documentation

◆ m_clid

CLID SG::DVLDataBucket< DV >::m_clid
privateinherited

The CLID for the class of object we're holding.

May be different from that of the base DataVector in the case of a ViewVector.

Definition at line 162 of file DVLDataBucket.h.

◆ m_cnvcopies

vec_t SG::DataBucket< DV >::m_cnvcopies
privateinherited

Definition at line 160 of file DataBucket.h.

◆ m_copies

vec_t SG::DVLDataBucket< DV >::m_copies
privateinherited

Definition at line 152 of file DVLDataBucket.h.

◆ m_ptr

DV* SG::DataBucket< DV >::m_ptr
privateinherited

Definition at line 155 of file DataBucket.h.

◆ m_ti

const std::type_info* SG::DVLDataBucket< DV >::m_ti
privateinherited

The std::type_info for the class of object we're holding.

May be different from that of the base DataVector in the case of a ViewVector.

Definition at line 157 of file DVLDataBucket.h.


The documentation for this class was generated from the following file: