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-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):
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):
19namespace xAOD {
20 class TVirtualEvent;
21}
22namespace ROOT { namespace Meta { namespace Selection {
23 template< class STORABLE >
24 class DataLink;
25}}}
26
36template< typename STORABLE >
37class DataLink : public DataLinkBase {
38
39public:
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
77 DataLink( const ID_type& id, xAOD::TVirtualEvent* event = 0 );
78
81
83 template< typename T >
84 DataLink( const DataLink< T >& parent );
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
138
139private:
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 */
159namespace ROOT { namespace Meta { namespace Selection {
160template< class STORABLE >
161class DataLink : public SelectNoInstance
162{
163
164public:
167
169 ROOT::Meta::Selection::MemberAttributes< kTransient > m_object;
171 ROOT::Meta::Selection::MemberAttributes< kTransient > m_event;
172
173};
174}}} // ROOT namespace
175
177template< typename STORABLE >
179 const DataLink< STORABLE >& b );
180
182template< 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
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.