ATLAS Offline Software
Loading...
Searching...
No Matches
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
13
15public:
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 )
23 m_type.Destruct( m_data );
24 }
25
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,
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,
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
65private:
66 void* m_data = nullptr;
69};
70
71#endif
uint32_t CLID
The Class ID type.
char data[hepevt_bytes_allocation_ATLAS]
Definition HepEvt.cxx:11
TTypeAdapter RootType
Definition RootType.h:211
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.
virtual void lock() override
If the held object derives from ILockable, call lock() on it.
BareDataBucket(void *data, CLID clid, RootType type)
BareDataBucket()=delete
BareDataBucket(BareDataBucket &&)=delete
BareDataBucket & operator=(const BareDataBucket &)=delete
BareDataBucket(const BareDataBucket &)=delete
virtual void relinquish() override
Give up ownership of the DataBucket contents.
virtual const CLID & clID() const override
virtual void * cast(CLID clid, SG::IRegisterTransient *, bool isConst=true) override
Return the contents of the DataBucket, converted to type given by clid.
virtual const std::type_info & tinfo() const override
Return the type_info for the stored object.
virtual ~BareDataBucket() override
virtual void * object() override
BareDataBucket & operator=(BareDataBucket &&)=delete
T * cast(SG::IRegisterTransient *irt=0, bool isConst=true)
Return the contents of the DataBucket, converted to type T.
Interface for registering a transient object in t2p map.
STL namespace.