ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Database
AthenaRoot
AthenaRootComps
src
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
18
#include "
AthenaKernel/DataBucketBase.h
"
19
20
#include "
DataModelRoot/RootType.h
"
21
22
namespace
Athena
{
23
24
class
DataBucketBranch
:
25
public
::DataBucketBase
26
{
27
public
:
28
DataBucketBranch
(
CLID
clid,
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
36
DataBucketBranch
(
CLID
clid,
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
55
using
DataBucketBase::cast
;
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
,
63
SG::IRegisterTransient
* itr,
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:
79
CLID
m_clid
;
80
RootType
m_type
;
81
void
*
m_ptr
;
82
83
bool
allowMismatchCLID
=
false
;
84
85
};
86
87
inline
88
void
*
89
DataBucketBranch::object
()
90
{
91
return
m_ptr
;
92
}
93
94
inline
95
void
96
DataBucketBranch::relinquish
()
97
{}
98
99
inline
100
void
101
DataBucketBranch::lock
()
102
{}
103
104
}
//> end namespace Athena
105
106
#endif
/* !ATHENAROOTCOMPS_ROOTDATABUCKETBRANCH_H */
107
DataBucketBase.h
CLID
uint32_t CLID
The Class ID type.
Definition
Event/xAOD/xAODCore/xAODCore/ClassID_traits.h:47
RootType.h
RootType
TTypeAdapter RootType
Definition
RootType.h:211
Athena::DataBucketBranch::clID
virtual const CLID & clID() const override
Definition
RootDataBucketBranch.h:71
Athena::DataBucketBranch::allowMismatchCLID
bool allowMismatchCLID
Definition
RootDataBucketBranch.h:83
Athena::DataBucketBranch::relinquish
virtual void relinquish() override
Give up ownership of the DataBucket contents.
Definition
RootDataBucketBranch.h:96
Athena::DataBucketBranch::DataBucketBranch
DataBucketBranch(CLID clid, const RootType &type, void *ptr)
Definition
RootDataBucketBranch.h:44
Athena::DataBucketBranch::m_clid
CLID m_clid
Definition
RootDataBucketBranch.h:79
Athena::DataBucketBranch::~DataBucketBranch
virtual ~DataBucketBranch() override
Definition
RootDataBucketBranch.cxx:21
Athena::DataBucketBranch::lock
virtual void lock() override
If the held object derives from ILockable, call lock() on it.
Definition
RootDataBucketBranch.h:101
Athena::DataBucketBranch::DataBucketBranch
DataBucketBranch(CLID clid, const std::string &type_name, void *ptr=NULL)
Definition
RootDataBucketBranch.h:28
Athena::DataBucketBranch::tinfo
virtual const std::type_info & tinfo() const override
Return the type_info for the stored object.
Definition
RootDataBucketBranch.h:73
Athena::DataBucketBranch::object
virtual void * object() override
Definition
RootDataBucketBranch.h:89
Athena::DataBucketBranch::m_ptr
void * m_ptr
Definition
RootDataBucketBranch.h:81
Athena::DataBucketBranch::m_type
RootType m_type
Definition
RootDataBucketBranch.h:80
Athena::DataBucketBranch::DataBucketBranch
DataBucketBranch(CLID clid, const std::type_info &ti, void *ptr=NULL)
Definition
RootDataBucketBranch.h:36
Athena::DataBucketBranch::cast
virtual void * cast(CLID clid, SG::IRegisterTransient *itr, bool isConst=true) override
Return the contents of the DataBucket, converted to type given by clid.
Definition
RootDataBucketBranch.cxx:27
DataBucketBase::DataBucketBase
DataBucketBase()
Definition
DataBucketBase.h:28
DataBucketBase::cast
T * cast(SG::IRegisterTransient *irt=0, bool isConst=true)
Return the contents of the DataBucket, converted to type T.
SG::IRegisterTransient
Interface for registering a transient object in t2p map.
Definition
IRegisterTransient.h:28
Athena
Some weak symbol referencing magic... These are declared in AthenaKernel/getMessageSvc....
Definition
AthDsoUtils.h:10
type
Generated on
for ATLAS Offline Software by
1.17.0