ATLAS Offline Software
A/AthLinks/DataLink.h
Go to the documentation of this file.
1 // Dear emacs, this is -*- c++ -*-
2 /*
3  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
4  */
5 #ifndef ATHLINKS_DATALINK_H
6 #define ATHLINKS_DATALINK_H
7 
8 // System include(s):
9 extern "C" {
10 # include <stdint.h>
11 }
12 #include <string>
13 #include <RootMetaSelection.h>
14 
15 // Local include(s):
16 #include "AthLinks/DataLinkBase.h"
17 
18 // Forward declaration(s):
19 namespace xAOD {
20  class TVirtualEvent;
21 }
22 namespace ROOT { namespace Meta { namespace Selection {
23  template< class STORABLE >
24  class DataLink;
25 }}}
26 
36 template< typename STORABLE >
37 class DataLink : public DataLinkBase {
38 
39 public:
42 
44  typedef std::string ID_type;
46  typedef uint32_t sgkey_t;
47 
49  typedef STORABLE value_type;
51  typedef STORABLE* __attribute__((deprecated)) pointer;
53  typedef const STORABLE* const_pointer;
55  typedef STORABLE& __attribute__((deprecated)) reference;
57  typedef const STORABLE& const_reference;
58 
60 
63 
66 
69 
72 
75 
78 
81 
83  template< typename T >
85 
87 
90 
93 
96 
98  void toIdentifiedObject( const ID_type& id );
101 
103 
106 
110  const_pointer operator->() const { return cptr(); }
111 
113  operator const_pointer() const { return cptr(); }
114 
117 
119  bool isValid() const;
120 
122  operator bool() const { return isValid(); }
124  bool operator!() const { return !isValid(); }
125 
127  const ID_type& dataID() const;
129  sgkey_t key() const { return persKey(); }
130 
132 
134  xAOD::TVirtualEvent* source() const { return m_event; }
135 
137  bool toPersistent();
138 
139 private:
141  virtual bool toTransient();
144 
149 
152 
153 }; // class DataLink
154 
155 /*
156  * The following piece of code declares the member variables of all
157  * DataLink<T> types as transient.
158  */
159 namespace ROOT { namespace Meta { namespace Selection {
160 template< class STORABLE >
161 class DataLink : public SelectNoInstance
162 {
163 
164 public:
166  typedef DataLink< STORABLE > self;
167 
169  ROOT::Meta::Selection::MemberAttributes< kTransient > m_object;
171  ROOT::Meta::Selection::MemberAttributes< kTransient > m_event;
172 
173 };
174 }}} // ROOT namespace
175 
177 template< typename STORABLE >
179  const DataLink< STORABLE >& b );
180 
182 template< typename STORABLE >
184  const DataLink< STORABLE >& b );
185 
186 // Include the implementation:
187 #ifndef __GCCXML__
188 # include "DataLink.icc"
189 #endif // __GCCXML__
190 
191 #endif // ATHLINKS_DATALINK_H
xAOD::TVirtualEvent
Base interface for getting objects out of the input file.
Definition: TVirtualEvent.h:32
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
xAOD
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
Definition: ICaloAffectedTool.h:24
event
POOL::TEvent event(POOL::TEvent::kClassAccess)
DataLinkBase::persKey
uint32_t persKey() const
Get the key/identifier of the referenced container.
Definition: DataLinkBase.cxx:13
test_pyathena.parent
parent
Definition: test_pyathena.py:15
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
runJobs.deprecated
deprecated
Definition: runJobs.py:191
a
TList * a
Definition: liststreamerinfos.cxx:10
DataLinkBase::sgkey_t
SG::DataProxyHolder::sgkey_t sgkey_t
Type of hashed keys.
Definition: AthLinks/DataLinkBase.h:42
DataLinkBase::ID_type
SG::DataProxyHolder::ID_type ID_type
Type of string keys.
Definition: AthLinks/DataLinkBase.h:45
SG::IConstAuxStore
Interface for const operations on an auxiliary store.
Definition: IConstAuxStore.h:64
xAOD::bool
setBGCode setTAP setLVL2ErrorBits bool
Definition: TrigDecision_v1.cxx:60
ROOT
Selection rules: declare transient members.
Definition: DataVector.h:580
DataLinkBase
Type-independent part of DataLink; holds the persistent state.
Definition: AthLinks/DataLinkBase.h:39