13#ifndef ATHLINKS_ELEMENTLINK_H
14#define ATHLINKS_ELEMENTLINK_H
18#include "AthLinks/DataLink.h"
122template <
class STORABLE>
128 typedef SG::ElementLinkTraits<STORABLE> Traits;
131 typedef typename Traits::Base Base;
134 typedef typename Base::castfn_t
castfn_t;
139 typedef typename Traits::IndexingPolicy IndexingPolicy;
142 typedef typename IndexingPolicy::index_type
index_type;
145 typedef typename Base::sgkey_t
sgkey_t;
148 typedef typename Base::ID_type
ID_type;
152 typedef STORABLE* pointer;
153 typedef const STORABLE* const_pointer;
159 typedef typename IndexingPolicy::ElementType
ElementType;
200 const EventContext& ctx);
252 const EventContext& ctx);
284 const EventContext& ctx);
308 const EventContext& ctx);
348 const EventContext& ctx);
517 const EventContext& ctx);
555 const EventContext& ctx);
607 const EventContext& ctx);
631 const EventContext& ctx);
655 const EventContext& ctx);
712template <
typename STORABLE>
722template <
typename STORABLE>
732template <
typename STORABLE>
742template <
typename STORABLE>
798template <
class STORABLE>
805 const EventContext& ctx);
813template <
class STORABLE,
class ALLOC>
820 const EventContext& ctx);
829template <
class STORABLE,
class ALLOC1,
class ALLOC2>
836 const EventContext& ctx);
850 :
public formatter<string_view>
852 template <
class FmtContext>
856 return formatter<string_view>::format (
"(nullLink)", ctx);
858 return format_to (ctx.out(),
"@{}[{}]", k.dataID(), k.index());
866#include "AthLinks/ElementLink.icc"
bool operator<(const ElementLink< STORABLE > &lhs, const ElementLink< STORABLE > &rhs)
Ordering relation for ElementLink (less-than).
DataLink< STORABLE > getDataLink()
Return a link to the currently-referenced container object.
bool operator>(const ElementLink< STORABLE > &lhs, const ElementLink< STORABLE > &rhs)
Ordering relation for ElementLink (greater-than).
const_pointer getDataPtr() const
Return a pointer to the currently-referenced container object.
bool operator!=(const ElementLink< STORABLE > &lhs, const ElementLink< STORABLE > &rhs)
Inequality relation for ElementLink.
void * storableNonConst()
Return a (void) pointer to the currently-referenced container object.
const void * storable() const
Return a (void) pointer to the currently-referenced container object.
bool operator==(const ElementLink< STORABLE > &lhs, const ElementLink< STORABLE > &rhs)
Equality relation for ElementLink.
pointer getDataNonConstPtr()
Return a pointer to the currently-referenced container object.
Determine dependent types for ElementLink classes.
uint32_t CLID
The Class ID type.
Define a hook for running code after an object has been read.
doing TRTHTH Hypo selection
Object reference supporting deferred reading from StoreGate.
void * castfn_t(SG::DataProxy *)
Function casting from a SG::DataProxy to a pointer.
ElementLink implementation for ROOT usage.
BaseConstReference getStorableObjectRef() const
Retrieve storable object reference.
bool setElement(ElementType element)
Set link to point to an Element (slowest).
const ID_type & dataID() const
Get the key that we reference, as a string.
ElementConstPointer operator->() const
Access the object as a smart pointer.
const STORABLE * BaseConstPointer
Constant pointer to the container.
BaseConstPointer getStorableObjectPointer() const
Retrieve storable object pointer.
STORABLE::value_type value_type
Type of the values inside the container.
bool toContainedElement(BaseConstReference container, ElementType element)
Set link to point to given element (slowest).
uint32_t sgkey_t
Integer identifier for the object in the event.
TypeTools::Copy< value_type >::const_pointer ElementConstPointer
Constant pointer to an element in the container.
ElementConstPointer cptr() const
Get a constant pointer to the referenced object.
ElementConstReference operator*() const
Get a reference to the object in question.
bool toIndexedElement(BaseConstReference container, index_type index)
Set link to point to given index (slower).
bool operator!() const
Operator checking the validity of the link.
TypeTools::Copy< value_type >::const_reference ElementConstReference
Constant reference to an element in the container.
std::string ID_type
Type of the "regular" identifiers in the event.
void resetWithKeyAndIndex(const ID_type &key, index_type index, xAOD::TVirtualEvent *event=0)
Reset with storable key and element index (fast).
bool isValid() const
Check if the element can be found.
sgkey_t key() const
Get the key that we reference, as a hash.
ElementLink & operator=(const ElementLink &rhs)
Assignment operator.
const STORABLE & BaseConstReference
Constant reference to the container.
size_t index_type
Type of the index used on the container.
ElementLink()
Default constructor.
TypeTools::Copy< value_type >::type ElementType
Type of the elements in the container.
bool setStorableObject(BaseConstReference data, bool replace=false)
Set link storable to data object pointed by data (slower).
ElementType cachedElement() const
Access the currently cached element. Doesn't trigger lookup.
ElementLinkTraits class to specialize.
static void toTransient(ElementLink< STORABLE > &el, const EventContext &ctx)
static void toTransient(ElementLink< STORABLE > &el, IProxyDict *sg=nullptr)
static void toTransient(std::vector< ElementLink< STORABLE >, ALLOC > &elv, IProxyDict *sg=nullptr)
static void toTransient(std::vector< ElementLink< STORABLE >, ALLOC > &elv, const EventContext &ctx)
static void toTransient(std::vector< std::vector< ElementLink< STORABLE >, ALLOC1 >, ALLOC2 > &elvv, const EventContext &ctx)
static void toTransient(std::vector< std::vector< ElementLink< STORABLE >, ALLOC1 >, ALLOC2 > &elvv, IProxyDict *sg=nullptr)
Define a hook for running code after an object has been read.
std::string replace(std::string s, const std::string &s2, const std::string &s3)
bool checkForRemap(IProxyDict *sg, SG::sgkey_t sgkey_in, size_t index_in, SG::sgkey_t &sgkey_out, size_t &index_out)
See if an EL is being remapped.
uint32_t sgkey_t
Type used for hashed StoreGate key+CLID pairs.
Some out-of-line helpers for ExtendedEventContext.