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-2017 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 
14 // Local include(s):
15 #include "AthLinks/DataLinkBase.h"
16 #include "AthLinks/tools/selection_ns.h"
17 
18 // Forward declaration(s):
19 namespace xAOD {
20  class TVirtualEvent;
21 }
23 template< class STORABLE >
24 class DataLink;
26 
38 template< typename STORABLE >
39 class DataLink : public DataLinkBase {
40 
41 public:
44 
46  typedef std::string ID_type;
48  typedef uint32_t sgkey_t;
49 
51  typedef STORABLE value_type;
53  typedef STORABLE* __attribute__((deprecated)) pointer;
55  typedef const STORABLE* const_pointer;
57  typedef STORABLE& __attribute__((deprecated)) reference;
59  typedef const STORABLE& const_reference;
60 
62 
65 
68 
71 
74 
77 
80 
83 
85  template< typename T >
87 
89 
92 
95 
98 
100  void toIdentifiedObject( const ID_type& id );
103 
105 
108 
112  const_pointer operator->() const { return cptr(); }
113 
115  operator const_pointer() const { return cptr(); }
116 
119 
121  bool isValid() const;
122 
124  operator bool() const { return isValid(); }
126  bool operator!() const { return !isValid(); }
127 
129  const ID_type& dataID() const;
131  sgkey_t key() const { return persKey(); }
132 
134 
136  xAOD::TVirtualEvent* source() const { return m_event; }
137 
139  bool toPersistent();
140 
141 private:
143  virtual bool toTransient();
146 
151 
153  typedef typename ROOT_SELECTION_NS::DataLink< STORABLE >::self DictSel;
154 
155 }; // class DataLink
156 
157 /*
158  * The following piece of code declares the member variables of all
159  * DataLink<T> types as transient.
160  */
162 template< class STORABLE >
163 class DataLink : public SelectNoInstance
164 {
165 
166 public:
168  typedef DataLink< STORABLE > self;
169 
171  ROOT_SELECTION_NS::MemberAttributes< kTransient > m_object;
173  ROOT_SELECTION_NS::MemberAttributes< kTransient > m_event;
174 
175 };
177 
179 template< typename STORABLE >
181  const DataLink< STORABLE >& b );
182 
184 template< typename STORABLE >
186  const DataLink< STORABLE >& b );
187 
188 // Include the implementation:
189 #ifndef __GCCXML__
190 # include "DataLink.icc"
191 #endif // __GCCXML__
192 
193 #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:40
DataLinkBase::ID_type
SG::DataProxyHolder::ID_type ID_type
Type of string keys.
Definition: AthLinks/DataLinkBase.h:43
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
DataLinkBase
Type-independent part of DataLink; holds the persistent state.
Definition: AthLinks/DataLinkBase.h:37