ATLAS Offline Software
Loading...
Searching...
No Matches
A/AthLinks/DataLink.h
Go to the documentation of this file.
1// Dear emacs, this is -*- c++ -*-
2/*
3 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
4 */
5#ifndef ATHLINKS_DATALINK_H
6#define ATHLINKS_DATALINK_H
7
8// System include(s):
9extern "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):
19class EventContext;
20namespace xAOD {
21 class TVirtualEvent;
22}
23namespace ROOT { namespace Meta { namespace Selection {
24 template< class STORABLE >
25 class DataLink;
26}}}
27
37template< typename STORABLE >
38class DataLink : public DataLinkBase {
39
40public:
43
45 typedef std::string ID_type;
47 typedef uint32_t sgkey_t;
48
50 typedef STORABLE value_type;
52 typedef STORABLE* __attribute__((deprecated)) pointer;
54 typedef const STORABLE* const_pointer;
56 typedef STORABLE& __attribute__((deprecated)) reference;
58 typedef const STORABLE& const_reference;
59
61
64
67
70
73
76
79 DataLink( const_pointer data, const EventContext& );
80
82 DataLink( const ID_type& id, xAOD::TVirtualEvent* event = 0 );
83
86
88 template< typename T >
89 DataLink( const DataLink< T >& parent );
90
92
95
98
101
103 void toIdentifiedObject( const ID_type& id );
106
108
111
115 const_pointer operator->() const { return cptr(); }
116
118 operator const_pointer() const { return cptr(); }
119
122
124 bool isValid() const;
125
127 operator bool() const { return isValid(); }
129 bool operator!() const { return !isValid(); }
130
132 const ID_type& dataID() const;
134 sgkey_t key() const { return persKey(); }
135
137
139 xAOD::TVirtualEvent* source() const { return m_event; }
140
143
145 bool toTransient( const EventContext& ) { return false; }
146
147private:
149 virtual bool toTransient();
152
157
160
161}; // class DataLink
162
163/*
164 * The following piece of code declares the member variables of all
165 * DataLink<T> types as transient.
166 */
167namespace ROOT { namespace Meta { namespace Selection {
168template< class STORABLE >
169class DataLink : public SelectNoInstance
170{
171
172public:
175
177 ROOT::Meta::Selection::MemberAttributes< kTransient > m_object;
179 ROOT::Meta::Selection::MemberAttributes< kTransient > m_event;
180
181};
182}}} // ROOT namespace
183
185template< typename STORABLE >
187 const DataLink< STORABLE >& b );
188
190template< typename STORABLE >
192 const DataLink< STORABLE >& b );
193
194// Include the implementation:
195#ifndef __GCCXML__
196# include "DataLink.icc"
197#endif // __GCCXML__
198
199#endif // ATHLINKS_DATALINK_H
char data[hepevt_bytes_allocation_ATLAS]
Definition HepEvt.cxx:11
static Double_t a
Type-independent part of DataLink; holds the persistent state.
uint32_t persKey() const
Get the key/identifier of the referenced container.
Base interface for getting objects out of the input file.
Selection rules: declare transient members.
Definition DataVector.h:581
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.