15#ifndef ATHLINKS_GENERICELEMENTLINKBASE_H
16#define ATHLINKS_GENERICELEMENTLINKBASE_H
20#include "AthLinks/DataLinkBase.h"
25#include <RootMetaSelection.h>
31 template<
class INDEXING_POLICY >
37template <
class POLICY>
75template <
class INDEXING_POLICY>
343 template <
class OTHER_INDEXING_POLICY,
class FROM_TRAITS,
class TO_TRAITS>
345 FROM_TRAITS*, TO_TRAITS*);
502 template <
class INDEX>
503 requires (std::convertible_to<INDEX, size_t> &&
504 std::convertible_to<size_t, INDEX>)
521 template <
class INDEX>
522 requires (!(std::convertible_to<INDEX, size_t> &&
523 std::convertible_to<size_t, INDEX>))
527 template <
class OTHER_POLICY>
531 template <
class POLICY>
532 friend class ::ElementLinkBaseT_test;
557namespace ROOT {
namespace Meta {
namespace Selection {
559template <
class INDEXING_POLICY>
562 ROOT::Meta::Selection::MemberAttributes<kTransient>
m_proxy;
564 ROOT::Meta::Selection::MemberAttributes<kTransient>
m_element;
Cached value with atomic update.
Manage DataProxy reference in ElementLink/DataLink.
uint32_t CLID
The Class ID type.
char data[hepevt_bytes_allocation_ATLAS]
Define macros for attributes used to control the static checker.
Cached value with atomic update.
Type-independent part of DataLink; holds the persistent state.
Manage DataProxy reference in ElementLink/DataLink.
SG::sgkey_t sgkey_t
Type of hashed keys.
std::string ID_type
Type of string keys.
const void * const_pointer_t
SG::DataProxyHolder::sgkey_t sgkey_t
Type of hashed keys.
GenericElementLinkBase(sgkey_t key, CLID link_clid, const index_type &elemID, const ElementType &elt, IProxyDict *sg)
Construct a link from a hashed key, index, AND pointer to element.
GenericElementLinkBase & operator=(const GenericElementLinkBase &)=default
bool toTransient(IProxyDict *sg=0)
Finish initialization after link has been read.
bool isDefault() const
Test to see if this link is in the default state.
IProxyDict * source() const
Return the data source for this reference.
stored_index_type m_index
bool thin()
Adjust for thinning.
void resetWithKeyAndIndex(const ID_type &dataID, CLID link_clid, const index_type &elemID, IProxyDict *sg)
Set the link to an element given by string key and index.
void storeCachedElement(const ElementType &elt)
Set the cached element stored in the link.
GenericElementLinkBase(const ID_type &dataID, CLID link_clid, const index_type &elemID, const ElementType &elt, IProxyDict *sg)
Construct a link from a string key, index, AND pointer to element.
GenericElementLinkBase(const DataLinkBase &dlink, const index_type &index)
Construct a link from a DataLink and an index.
void reset()
Reset the link to a null state.
const SG::DataProxyHolder & proxyHolder() const
Return the internal proxy holder object.
INDEXING_POLICY::index_type index_type
The index type presented to and returned from the link.
index_type index() const
Return the index of the link.
GenericElementLinkBase(const ID_type &dataID, CLID link_clid, const index_type &elemID, IProxyDict *sg)
Construct a link from a string key and an index.
SG::DataProxyHolder m_proxy
void setCachedElement(const ElementType &elt) const
Set the cached element stored in the link.
void * castfn_t(SG::DataProxy *)
Function casting from a SG::DataProxy to a pointer.
SG::DataProxyHolder::ID_type ID_type
Type of string keys.
INDEXING_POLICY::ElementType ElementType
Generic pointer to an element.
SG::DataProxyHolder::const_pointer_t const_pointer_t
Generic pointer to the container (storable).
bool isDefaultIndex() const
Test the index validity.
GenericElementLinkBase()
Default constructor.
ROOT::Meta::Selection::SG::GenericElementLinkBase< INDEXING_POLICY >::self DictSel
Transient.
INDEXING_POLICY::ElementConstPointer ElementConstPointer
const ID_type & dataID() const
Return the SG key that we reference, as a string.
const stored_index_type & storedIndex() const
Return the stored representation of the link index.
void resetWithKeyAndIndex(sgkey_t key, CLID link_clid, const index_type &elemID, IProxyDict *sg)
Set the link to an element given by string key and index.
bool thin(const SG::ThinningCache *thinningCache)
Adjust for thinning.
friend class GenericElementLinkBase
GenericElementLinkBase(const_pointer_t obj, CLID link_clid, const index_type &elemID, IProxyDict *sg)
Construct a link from an index and pointer to the container.
GenericElementLinkBase(const GenericElementLinkBase< OTHER_INDEXING_POLICY > &other, FROM_TRAITS *, TO_TRAITS *)
Constructor from a link referencing a different type.
GenericElementLinkBase(const GenericElementLinkBase &)=default
bool setStorableObject(const_pointer_t data, CLID link_clid, bool replace, IProxyDict *sg)
Set the container referenced by the link to data.
INDEXING_POLICY::stored_index_type stored_index_type
The type of the index as it is stored internally.
const SG::DataProxy * proxy() const
Return the SG proxy for the container holding this element.
bool toPersistent()
Prepare this link for writing.
GenericElementLinkBase(const GenericElementLinkBase &other, const index_type &elemID)
Construct a link from another link, changing the index.
bool hasCachedElement() const
Test to see if this link has a cached element pointer.
bool getCachedElement(ElementConstPointer &elt) const
Retrieve the cached element from the link.
CxxUtils::CachedValue< ElementType > m_element
bool toIndexedElement(const_pointer_t obj, CLID link_clid, const index_type &elemID, IProxyDict *sg)
Set the to an element given by index and pointer to container.
bool thin1(INDEX &persIndex, const SG::ThinningCache *thinningCache)
void * storableBase(castfn_t *castfn, const CLID &clid, bool isConst) const
Return a pointer to the currently-referenced container object.
GenericElementLinkBase(sgkey_t key, CLID link_clid, const index_type &elemID, IProxyDict *sg)
Construct a link from a hashed key and an index.
sgkey_t key() const
Return the SG key that we reference, as a hash.
void setIndex(const index_type &index)
Set the index part of the link.
Cache thinning decisions for converters.
Helpers to retrieve the current thinning cache from the event context.
std::string replace(std::string s, const std::string &s2, const std::string &s3)
Selection rules: declare transient members.
uint32_t sgkey_t
Type used for hashed StoreGate key+CLID pairs.