ATLAS Offline Software
AthLinks/DataLink.h
Go to the documentation of this file.
1 // This file's extension implies that it's C, but it's really -*- C++ -*-.
2 
3 /*
4  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
5 */
14 #ifndef ATHLINKS_DATALINK_H
15 #define ATHLINKS_DATALINK_H
16 
17 
18 #include "AthLinks/DataLinkBase.h"
21 class EventContext;
22 class IProxyDict;
23 
24 
90 template <class STORABLE>
91 class DataLink
92  : public DataLinkBase
93 {
94 public:
96  typedef STORABLE value_type;
97  typedef STORABLE* pointer;
98  typedef const STORABLE* const_pointer;
99  typedef STORABLE& reference;
100  typedef const STORABLE& const_reference;
101 
104 
107 
108 
112  static const CLID& classID();
113 
114 
115  //========================================================================
118 
119 
124 
125 
132 
133 
139  DataLink(const_reference data, const EventContext& ctx);
140 
141 
148 
149 
155  DataLink(const_pointer pdata, const EventContext& ctx);
156 
157 
164 
165 
171  DataLink(const ID_type& dataID, const EventContext& ctx);
172 
173 
182 
183 
191  DataLink(sgkey_t key, const EventContext& ctx);
192 
193 
201 
202 
204  //========================================================================
207 
208 
219 
220 
226  void toStorableObject(const_reference data, const EventContext& ctx);
227 
228 
239 
240 
246  void toIdentifiedObject(const ID_type& dataID, const EventContext& ctx);
247 
248 
261 
262 
270  void toIdentifiedObject(sgkey_t key, const EventContext& ctx);
271 
272 
287  void toDefaultObject (IProxyDict* sg = 0);
288 
289 
300  void toDefaultObject (const EventContext& ctx);
301 
302 
313  bool toTransient (IProxyDict* sg = 0);
314 
315 
324  bool toTransient (const EventContext& ctx);
325 
326 
338  bool toTransient (const ID_type& dataID, IProxyDict* sg = 0);
339 
340 
350  bool toTransient (const ID_type& dataID, const EventContext& ctx);
351 
352 
353 
355  //========================================================================
358 
365 
366 
373 
374 
379 
380 
385 
386 
390  operator const_pointer() const;
391 
392 
397 
398 
402  bool isValid() const;
403 
404 
405 
409  bool operator!() const;
410 
411 
412  // Inherited from base class:
413  // bool isDefault() const;
414  // const ID_type& dataID() const;
415  // sgkey_t key() const;
416  // void clear();
417  // SG::DataProxy* proxy (bool nothrow = false) const;
418  // IProxyDict* source() const;
419  // bool toPersistent();
420  // bool toPersistentNoRemap();
421  // bool operator== (const DataLinkBase& other) const;
422  // bool operator!= (const DataLinkBase& other) const;
423 
424 
425 private:
431  const void* storable() const;
432 
433 
440 };
441 
442 
443 #include "AthLinks/DataLink.icc"
444 
445 
446 #endif // not ATHLINKS_DATALINK_H
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
IProxyDict
A proxy dictionary.
Definition: AthenaKernel/AthenaKernel/IProxyDict.h:47
ClassID_traits.h
a traits class that associates a CLID to a type T It also detects whether T inherits from Gaudi DataO...
SG::DataProxyHolder
Manage DataProxy reference in ElementLink/DataLink.
Definition: DataProxyHolder.h:61
CLID
uint32_t CLID
The Class ID type.
Definition: Event/xAOD/xAODCore/xAODCore/ClassID_traits.h:47
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
DefaultKey.h
DataLinkBase
Type-independent part of DataLink; holds the persistent state.
Definition: AthLinks/DataLinkBase.h:39