ATLAS Offline Software
BareDataBucket.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3 */
4 #ifndef TrigOutputHandling_BareDataBucket_h
5 #define TrigOutputHandling_BareDataBucket_h
8 
15 public:
16  BareDataBucket() = delete;
17 
19  : m_data(data), m_clid(clid), m_type( std::move(type) ){}
20 
21  virtual ~BareDataBucket() override {
22  if ( m_data != nullptr )
24  }
25 
26  BareDataBucket(const BareDataBucket&) = delete;
30 
31  // DataObject overrides
32  virtual const CLID& clID() const override {
33  return m_clid;
34  }
35 
36  // DataBucketBase overrides
37 
38  virtual void* object() override {
39  return m_data;
40  }
41 
42  virtual const std::type_info& tinfo() const override {
43  return m_type.TypeInfo();
44  };
45 
47  virtual void* cast (CLID clid,
48  SG::IRegisterTransient* /*irt*/,
49  bool isConst = true) override {
50  return ( m_clid == clid and isConst ) ? m_data : nullptr;
51  }
52 
53  virtual void* cast (const std::type_info& tinfo,
54  SG::IRegisterTransient* /*irt*/,
55  bool isConst = true) override {
56  return ( tinfo == m_type.TypeInfo() and isConst ) ? m_data : nullptr;
57  }
58 
59  virtual void relinquish() override {
60  m_data = nullptr;
61  };
62 
63  virtual void lock() override { /*not lockable I think */ };
64 
65 private:
66  void* m_data = nullptr;
67  CLID m_clid = 0;
69 };
70 
71 #endif
BareDataBucket::relinquish
virtual void relinquish() override
Give up ownership of the DataBucket contents.
Definition: BareDataBucket.h:59
BareDataBucket::~BareDataBucket
virtual ~BareDataBucket() override
Definition: BareDataBucket.h:21
SG::IRegisterTransient
Interface for registering a transient object in t2p map.
Definition: IRegisterTransient.h:28
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
BareDataBucket::operator=
BareDataBucket & operator=(const BareDataBucket &)=delete
BareDataBucket::cast
virtual void * cast(CLID clid, SG::IRegisterTransient *, bool isConst=true) override
Return the contents of the DataBucket, converted to type given by clid.
Definition: BareDataBucket.h:47
BareDataBucket
Allows to insert void* returned from serialisation into the store.
Definition: BareDataBucket.h:14
DataBucketBase
A non-templated base class for DataBucket, allows to access the transient object address as a void*.
Definition: DataBucketBase.h:24
DataBucketBase.h
BareDataBucket::clID
virtual const CLID & clID() const override
Definition: BareDataBucket.h:32
BareDataBucket::tinfo
virtual const std::type_info & tinfo() const override
Return the type_info for the stored object.
Definition: BareDataBucket.h:42
BareDataBucket::object
virtual void * object() override
Definition: BareDataBucket.h:38
DataBucketBase::cast
T * cast(SG::IRegisterTransient *irt=0, bool isConst=true)
Return the contents of the DataBucket, converted to type T.
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::BareDataBucket
BareDataBucket(void *data, CLID clid, RootType type)
Definition: BareDataBucket.h:18
BareDataBucket::operator=
BareDataBucket & operator=(BareDataBucket &&)=delete
BareDataBucket::lock
virtual void lock() override
If the held object derives from ILockable, call lock() on it.
Definition: BareDataBucket.h:63
BareDataBucket::m_clid
CLID m_clid
Definition: BareDataBucket.h:67
BareDataBucket::BareDataBucket
BareDataBucket(BareDataBucket &&)=delete
CLID
uint32_t CLID
The Class ID type.
Definition: Event/xAOD/xAODCore/xAODCore/ClassID_traits.h:47
BareDataBucket::BareDataBucket
BareDataBucket(const BareDataBucket &)=delete
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
TScopeAdapter::Destruct
void Destruct(void *place) const
Definition: RootType.cxx:672
RootType.h
BareDataBucket::BareDataBucket
BareDataBucket()=delete
BareDataBucket::cast
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.
Definition: BareDataBucket.h:53
TScopeAdapter
Definition: RootType.h:119