ATLAS Offline Software
Loading...
Searching...
No Matches
RootDataBucketBranch.h
Go to the documentation of this file.
1
2
3/*
4 Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
5*/
6
7// RootDataBucketBranch.h
8// Header file for class Athena::RootDataBucketBranch
9// Author: S.Binet<binet@cern.ch>
11#ifndef ATHENAROOTCOMPS_ROOTDATABUCKETBRANCH_H
12#define ATHENAROOTCOMPS_ROOTDATABUCKETBRANCH_H 1
13
14// STL includes
15#include <string>
16#include <stdexcept>
17
19
21
22namespace Athena {
23
25 public ::DataBucketBase
26{
27public:
29 const std::string& type_name,
30 void *ptr = NULL) :
31 m_clid(clid),
32 m_type(RootType(type_name)),
33 m_ptr(ptr)
34 {}
35
37 const std::type_info& ti,
38 void *ptr = NULL) :
39 m_clid(clid),
40 m_type(RootType(ti)),
41 m_ptr(ptr)
42 {}
43
44 DataBucketBranch(CLID clid, const RootType& type, void* ptr) :
45 m_clid(clid),
46 m_type(type),
47 m_ptr(ptr)
48 {}
49
50 virtual ~DataBucketBranch() override;
51
52 virtual
53 void* object() override;
54
56
57 virtual
58 void* cast(CLID clid, SG::IRegisterTransient* itr,
59 bool isConst = true) override;
60
61 virtual
62 void* cast(const std::type_info& tinfo,
64 bool isConst = true) override;
65
66 virtual
67 void relinquish() override;
68
69 virtual void lock() override;
70
71 virtual const CLID& clID() const override { return m_clid; }
72
73 virtual const std::type_info& tinfo() const override
74 {
75 return m_type.TypeInfo();
76 }
77
78 //private:
81 void* m_ptr;
82
84
85};
86
87inline
88void*
90{
91 return m_ptr;
92}
93
94inline
95void
98
99inline
100void
103
104} //> end namespace Athena
105
106#endif /* !ATHENAROOTCOMPS_ROOTDATABUCKETBRANCH_H */
107
uint32_t CLID
The Class ID type.
TTypeAdapter RootType
Definition RootType.h:211
virtual const CLID & clID() const override
virtual void relinquish() override
Give up ownership of the DataBucket contents.
DataBucketBranch(CLID clid, const RootType &type, void *ptr)
virtual ~DataBucketBranch() override
virtual void lock() override
If the held object derives from ILockable, call lock() on it.
DataBucketBranch(CLID clid, const std::string &type_name, void *ptr=NULL)
virtual const std::type_info & tinfo() const override
Return the type_info for the stored object.
virtual void * object() override
DataBucketBranch(CLID clid, const std::type_info &ti, void *ptr=NULL)
virtual void * cast(CLID clid, SG::IRegisterTransient *itr, bool isConst=true) override
Return the contents of the DataBucket, converted to type given by clid.
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.
Some weak symbol referencing magic... These are declared in AthenaKernel/getMessageSvc....