ATLAS Offline Software
DataBucketBase.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef ATHENAKERNEL_DATABUCKETBASE_H
6 #define ATHENAKERNEL_DATABUCKETBASE_H
7 
16 #include "GaudiKernel/DataObject.h"
17 #include <typeinfo>
18 
19 namespace SG {
20  class IRegisterTransient;
21 }
22 
23 class DataBucketBase : public DataObject
24 {
25 
26  public:
27 
29  virtual ~DataBucketBase() { };
30  virtual void* object() = 0;
31 
35  virtual const std::type_info& tinfo() const = 0;
36 
45  template <class T> T* cast (SG::IRegisterTransient* irt = 0,
46  bool isConst = true);
47 
56  virtual void* cast (CLID clid,
57  SG::IRegisterTransient* irt = 0,
58  bool isConst = true) = 0;
59 
68  virtual void* cast (const std::type_info& tinfo,
69  SG::IRegisterTransient* irt = 0,
70  bool isConst = true) = 0;
71 
84  virtual void* cast (CLID clid,
85  const std::type_info& tinfo,
86  SG::IRegisterTransient* irt = 0,
87  bool isConst = true);
88 
93  virtual void relinquish() = 0;
94 
98  virtual void lock() = 0;
99 };
100 
101 
103 
104 
105 #endif
106 
SG::IRegisterTransient
Interface for registering a transient object in t2p map.
Definition: IRegisterTransient.h:28
SG
Forward declaration.
Definition: CaloCellPacker_400_500.h:32
DataBucketBase::lock
virtual void lock()=0
If the held object derives from ILockable, call lock() on it.
DataBucketBase
A non-templated base class for DataBucket, allows to access the transient object address as a void*.
Definition: DataBucketBase.h:24
DataBucketBase::object
virtual void * object()=0
DataBucketBase.icc
DataBucketBase::cast
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.
DataBucketBase::cast
T * cast(SG::IRegisterTransient *irt=0, bool isConst=true)
Return the contents of the DataBucket, converted to type T.
DataBucketBase::cast
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.
DataBucketBase::cast
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.
DataBucketBase::~DataBucketBase
virtual ~DataBucketBase()
Definition: DataBucketBase.h:29
CLID
uint32_t CLID
The Class ID type.
Definition: Event/xAOD/xAODCore/xAODCore/ClassID_traits.h:47
DataBucketBase::DataBucketBase
DataBucketBase()
Definition: DataBucketBase.h:28
DataBucketBase::relinquish
virtual void relinquish()=0
Give up ownership of the DataBucket contents.
DataBucketBase::tinfo
virtual const std::type_info & tinfo() const =0
Return the type_info for the stored object.
TSU::T
unsigned long long T
Definition: L1TopoDataTypes.h:35