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
144private:
146 virtual bool toTransient();
149
154
157
158}; // class DataLink
159
160/*
161 * The following piece of code declares the member variables of all
162 * DataLink<T> types as transient.
163 */
164namespace ROOT { namespace Meta { namespace Selection {
165template< class STORABLE >
166class DataLink : public SelectNoInstance
167{
168
169public:
172
174 ROOT::Meta::Selection::MemberAttributes< kTransient > m_object;
176 ROOT::Meta::Selection::MemberAttributes< kTransient > m_event;
177
178};
179}}} // ROOT namespace
180
182template< typename STORABLE >
184 const DataLink< STORABLE >& b );
185
187template< typename STORABLE >
189 const DataLink< STORABLE >& b );
190
191// Include the implementation:
192#ifndef __GCCXML__
193# include "DataLink.icc"
194#endif // __GCCXML__
195
196#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.