ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
BareDataBucket Class Reference

Allows to insert void* returned from serialisation into the store. More...

#include <BareDataBucket.h>

Inheritance diagram for BareDataBucket:
Collaboration diagram for BareDataBucket:

Public Member Functions

 BareDataBucket ()=delete
 
 BareDataBucket (void *data, CLID clid, RootType type)
 
virtual ~BareDataBucket () override
 
 BareDataBucket (const BareDataBucket &)=delete
 
 BareDataBucket (BareDataBucket &&)=delete
 
BareDataBucketoperator= (const BareDataBucket &)=delete
 
BareDataBucketoperator= (BareDataBucket &&)=delete
 
virtual const CLIDclID () const override
 
virtual void * object () override
 
virtual const std::type_info & tinfo () const override
 Return the type_info for the stored object. More...
 
virtual void * cast (CLID clid, SG::IRegisterTransient *, bool isConst=true) override
 Return the contents of the DataBucket, converted to type given by clid. More...
 
virtual void * cast (const std::type_info &tinfo, SG::IRegisterTransient *, bool isConst=true) override
 Return the contents of the DataBucket, converted to type given by std::type_info. More...
 
virtual void relinquish () override
 Give up ownership of the DataBucket contents. More...
 
virtual void lock () override
 If the held object derives from ILockable, call lock() on it. More...
 
template<class T >
T * cast (SG::IRegisterTransient *irt=0, bool isConst=true)
 Return the contents of the DataBucket, converted to type T. More...
 
virtual void * cast (CLID clid, SG::IRegisterTransient *irt=0, bool isConst=true)=0
 Return the contents of the DataBucket, converted to type given by clid. More...
 
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. More...
 
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. More...
 
template<class T >
T * cast (SG::IRegisterTransient *irt=0, bool isConst=true)
 Return the contents of the DataBucket, converted to type T. More...
 
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. More...
 

Private Attributes

void * m_data = nullptr
 
CLID m_clid = 0
 
RootType m_type
 

Detailed Description

Allows to insert void* returned from serialisation into the store.

Definition at line 14 of file BareDataBucket.h.

Constructor & Destructor Documentation

◆ BareDataBucket() [1/4]

BareDataBucket::BareDataBucket ( )
delete

◆ BareDataBucket() [2/4]

BareDataBucket::BareDataBucket ( void *  data,
CLID  clid,
RootType  type 
)
inline

Definition at line 18 of file BareDataBucket.h.

19  : m_data(data), m_clid(clid), m_type( std::move(type) ){}

◆ ~BareDataBucket()

virtual BareDataBucket::~BareDataBucket ( )
inlineoverridevirtual

Definition at line 21 of file BareDataBucket.h.

21  {
22  if ( m_data != nullptr )
24  }

◆ BareDataBucket() [3/4]

BareDataBucket::BareDataBucket ( const BareDataBucket )
delete

◆ BareDataBucket() [4/4]

BareDataBucket::BareDataBucket ( BareDataBucket &&  )
delete

Member Function Documentation

◆ cast() [1/8]

virtual void* DataBucketBase::cast

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.

◆ cast() [2/8]

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 xAODPrivate::THolderBucket, SG::DVLDataBucket< T >, SG::DVLDataBucket< DV >, SG::DataBucket< T >, SG::DataBucket< DV >, and SG::MetaContDataBucket< T >.

◆ cast() [3/8]

virtual void* BareDataBucket::cast ( CLID  clid,
SG::IRegisterTransient irt,
bool  isConst = true 
)
inlineoverridevirtual

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.

Implements DataBucketBase.

Definition at line 47 of file BareDataBucket.h.

49  {
50  return ( m_clid == clid and isConst ) ? m_data : nullptr;
51  }

◆ cast() [4/8]

virtual void* DataBucketBase::cast

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.

◆ cast() [5/8]

virtual void* BareDataBucket::cast ( const std::type_info &  tinfo,
SG::IRegisterTransient irt,
bool  isConst = true 
)
inlineoverridevirtual

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.

Implements DataBucketBase.

Definition at line 53 of file BareDataBucket.h.

55  {
56  return ( tinfo == m_type.TypeInfo() and isConst ) ? m_data : nullptr;
57  }

◆ cast() [6/8]

virtual void* DataBucketBase::cast

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.

◆ cast() [7/8]

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() [8/8]

template<class T >
T* DataBucketBase::cast ( class T  )

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.

◆ clID()

virtual const CLID& BareDataBucket::clID ( ) const
inlineoverridevirtual

Definition at line 32 of file BareDataBucket.h.

32  {
33  return m_clid;
34  }

◆ lock()

virtual void BareDataBucket::lock ( )
inlineoverridevirtual

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

Implements DataBucketBase.

Definition at line 63 of file BareDataBucket.h.

63 { /*not lockable I think */ };

◆ object()

virtual void* BareDataBucket::object ( )
inlineoverridevirtual

Implements DataBucketBase.

Definition at line 38 of file BareDataBucket.h.

38  {
39  return m_data;
40  }

◆ operator=() [1/2]

BareDataBucket& BareDataBucket::operator= ( BareDataBucket &&  )
delete

◆ operator=() [2/2]

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

◆ relinquish()

virtual void BareDataBucket::relinquish ( )
inlineoverridevirtual

Give up ownership of the DataBucket contents.

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

Implements DataBucketBase.

Definition at line 59 of file BareDataBucket.h.

59  {
60  m_data = nullptr;
61  };

◆ tinfo()

virtual const std::type_info& BareDataBucket::tinfo ( ) const
inlineoverridevirtual

Return the type_info for the stored object.

Implements DataBucketBase.

Definition at line 42 of file BareDataBucket.h.

42  {
43  return m_type.TypeInfo();
44  };

Member Data Documentation

◆ m_clid

CLID BareDataBucket::m_clid = 0
private

Definition at line 67 of file BareDataBucket.h.

◆ m_data

void* BareDataBucket::m_data = nullptr
private

Definition at line 66 of file BareDataBucket.h.

◆ m_type

RootType BareDataBucket::m_type
private

Definition at line 68 of file BareDataBucket.h.


The documentation for this class was generated from the following file:
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
BareDataBucket::tinfo
virtual const std::type_info & tinfo() const override
Return the type_info for the stored object.
Definition: BareDataBucket.h:42
BareDataBucket::m_data
void * m_data
Definition: BareDataBucket.h:66
BareDataBucket::m_type
RootType m_type
Definition: BareDataBucket.h:68
TScopeAdapter::TypeInfo
const std::type_info & TypeInfo() const
Definition: RootType.cxx:679
BareDataBucket::m_clid
CLID m_clid
Definition: BareDataBucket.h:67
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
TScopeAdapter::Destruct
void Destruct(void *place) const
Definition: RootType.cxx:672