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-2019 CERN for the benefit of the ATLAS collaboration
5 */
6 
7 // $Id: DataLink.h 783590 2016-11-11 00:38:09Z ssnyder $
16 #ifndef ATHLINKS_DATALINK_H
17 #define ATHLINKS_DATALINK_H
18 
19 
20 #include "AthLinks/DataLinkBase.h"
23 #include "GaudiKernel/EventContext.h"
24 class IProxyDict;
25 
26 
92 template <class STORABLE>
93 class DataLink
94  : public DataLinkBase
95 {
96 public:
98  typedef STORABLE value_type;
99  typedef STORABLE* pointer;
100  typedef const STORABLE* const_pointer;
101  typedef STORABLE& reference;
102  typedef const STORABLE& const_reference;
103 
106 
109 
110 
114  static const CLID& classID();
115 
116 
117  //========================================================================
120 
121 
126 
127 
134 
135 
141  DataLink(const_reference data, const EventContext& ctx);
142 
143 
150 
151 
157  DataLink(const_pointer pdata, const EventContext& ctx);
158 
159 
166 
167 
173  DataLink(const ID_type& dataID, const EventContext& ctx);
174 
175 
184 
185 
193  DataLink(sgkey_t key, const EventContext& ctx);
194 
195 
203 
204 
206  //========================================================================
209 
210 
221 
222 
228  void toStorableObject(const_reference data, const EventContext& ctx);
229 
230 
241 
242 
248  void toIdentifiedObject(const ID_type& dataID, const EventContext& ctx);
249 
250 
263 
264 
272  void toIdentifiedObject(sgkey_t key, const EventContext& ctx);
273 
274 
289  void toDefaultObject (IProxyDict* sg = 0);
290 
291 
302  void toDefaultObject (const EventContext& ctx);
303 
304 
315  bool toTransient (IProxyDict* sg = 0);
316 
317 
326  bool toTransient (const EventContext& ctx);
327 
328 
340  bool toTransient (const ID_type& dataID, IProxyDict* sg = 0);
341 
342 
352  bool toTransient (const ID_type& dataID, const EventContext& ctx);
353 
354 
355 
357  //========================================================================
360 
367 
368 
375 
376 
381 
382 
387 
388 
392  operator const_pointer() const;
393 
394 
399 
400 
404  bool isValid() const;
405 
406 
407 
411  bool operator!() const;
412 
413 
414  // Inherited from base class:
415  // bool isDefault() const;
416  // const ID_type& dataID() const;
417  // sgkey_t key() const;
418  // void clear();
419  // SG::DataProxy* proxy (bool nothrow = false) const;
420  // IProxyDict* source() const;
421  // bool toPersistent();
422  // bool toPersistentNoRemap();
423  // bool operator== (const DataLinkBase& other) const;
424  // bool operator!= (const DataLinkBase& other) const;
425 
426 
427 private:
433  const void* storable() const;
434 
435 
442 };
443 
444 
445 #include "AthLinks/DataLink.icc"
446 
447 
448 #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:51
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: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
DefaultKey.h
DataLinkBase
Type-independent part of DataLink; holds the persistent state.
Definition: AthLinks/DataLinkBase.h:37