13#ifndef ATHLINKS_DATALINK_H
14#define ATHLINKS_DATALINK_H
17#include "AthLinks/DataLinkBase.h"
93template <
class STORABLE>
452template <
class STORABLE>
459 const EventContext& ctx);
467template <
class STORABLE,
class ALLOC>
474 const EventContext& ctx);
482template <
class STORABLE,
class ALLOC1,
class ALLOC2>
489 const EventContext& ctx);
503 :
public formatter<string_view>
505 template <
class FmtContext>
509 return formatter<string_view>::format (
"(nullLink)", ctx);
511 return std::format_to (ctx.out(),
"@{}", k.dataID());
519#include "AthLinks/DataLink.icc"
a traits class that associates a CLID to a type T It also detects whether T inherits from Gaudi DataO...
uint32_t CLID
The Class ID type.
Define a hook for running code after an object has been read.
SG::DataProxyHolder::sgkey_t sgkey_t
Type of hashed keys.
DataLinkBase()
Default constructor.
SG::DataProxyHolder::ID_type ID_type
Type of string keys.
Object reference supporting deferred reading from StoreGate.
const_pointer operator->() const
Dereference the link.
DataLink(const_reference data, const EventContext &ctx)
Constructor — link to a STORABLE using a transient ref to it.
const ID_type & dataID() const
bool toTransient(const ID_type &dataID, const EventContext &ctx)
Finish initialization like the link as just been read from root, but with a specified key.
void toStorableObject(const_reference data, IProxyDict *sg=0)
Set the link to an object given by a reference.
DataLink(sgkey_t key, const SG::DataProxyHolder &holder)
Constructor from a hashed key and a proxy holder object.
DataLinkBase::ID_type ID_type
const_reference operator*() const
Dereference the link.
void toIdentifiedObject(const ID_type &dataID, const EventContext &ctx)
Set the link to an object given by a string key.
DataLink(sgkey_t key, IProxyDict *sg=0)
Constructor — link to a STORABLE using a hashed ID.
pointer getDataNonConstPtr()
Return a pointer to the currently-referenced object.
DataLinkBase::sgkey_t sgkey_t
const_pointer getDataPtr() const
Return a pointer to the currently-referenced object.
const CONT * const_pointer
DataLink(const_pointer pdata, IProxyDict *sg=0)
Constructor — link to a STORABLE using a transient pointer to it.
void toIdentifiedObject(sgkey_t key, const EventContext &ctx)
Set the link to an object given by a hashed key.
bool toTransient(const EventContext &ctx)
Finish initialization after link has been read.
DataLink(const_pointer pdata, const EventContext &ctx)
Constructor — link to a STORABLE using a transient pointer to it.
DataLink(const ID_type &dataID, const EventContext &ctx)
Constructor — link to a STORABLE using a string ID.
bool operator!() const
True if the link is not dereferencable.
void * storableNonConst()
Return a (void) pointer to the currently-referenced object.
static CLID classID()
Return the CLID for the class that we reference.
bool toTransient(const ID_type &dataID, IProxyDict *sg=0)
Finish initialization like the link as just been read from root, but with a specified key.
DataLink(sgkey_t key, const EventContext &ctx)
Constructor — link to a STORABLE using a hashed ID.
void toIdentifiedObject(sgkey_t key, IProxyDict *sg=0)
Set the link to an object given by a hashed key.
DataLink()
Default constructor — gives the equivalent of a NULL pointer.
void toStorableObject(const_reference data, const EventContext &ctx)
Set the link to an object given by a reference.
void toIdentifiedObject(const ID_type &dataID, IProxyDict *sg=0)
Set the link to an object given by a string key.
void toDefaultObject(IProxyDict *sg=0)
Set the link to the default object of this type.
const_pointer cptr() const
Dereference the link.
bool isValid() const
Test to see if the link is dereferencable.
const void * storable() const
Return a (void) pointer to the currently-referenced object.
DataLink(const ID_type &dataID, IProxyDict *sg=0)
Constructor — link to a STORABLE using a string ID.
void toDefaultObject(const EventContext &ctx)
Set the link to the default object of this type.
DataLink(const_reference data, IProxyDict *sg=0)
Constructor — link to a STORABLE using a transient ref to it.
bool toTransient(IProxyDict *sg=0)
Finish initialization after link has been read.
const CONT & const_reference
Manage DataProxy reference in ElementLink/DataLink.
static void toTransient(DataLink< STORABLE > &dl, IProxyDict *sg=nullptr)
static void toTransient(DataLink< STORABLE > &dl, const EventContext &ctx)
static void toTransient(std::vector< DataLink< STORABLE >, ALLOC > &dlv, const EventContext &ctx)
static void toTransient(std::vector< DataLink< STORABLE >, ALLOC > &dlv, IProxyDict *sg=nullptr)
static void toTransient(std::vector< std::vector< DataLink< STORABLE >, ALLOC1 >, ALLOC2 > &dlvv, const EventContext &ctx)
static void toTransient(std::vector< std::vector< DataLink< STORABLE >, ALLOC1 >, ALLOC2 > &dlvv, IProxyDict *sg=nullptr)
Define a hook for running code after an object has been read.
Some out-of-line helpers for ExtendedEventContext.