|
ATLAS Offline Software
|
Go to the documentation of this file.
14 #ifndef ATHLINKS_ELEMENTLINKBASE_H
15 #define ATHLINKS_ELEMENTLINKBASE_H
20 #include "AthLinks/DataLinkBase.h"
347 template <
class FROM_TRAITS,
class TO_TRAITS>
349 FROM_TRAITS*, TO_TRAITS*);
516 #endif // not ATHLINKS_ELEMENTLINKBASE_H
SG::DataProxyHolder::const_pointer_t const_pointer_t
Generic pointer to the container (storable).
std::string replace(std::string s, const std::string &s2, const std::string &s3)
const SG::DataProxyHolder & proxyHolder() const
Return the internal proxy holder object.
char data[hepevt_bytes_allocation_ATLAS]
void storeCachedElement(ElementType elt)
Set the cached element stored in the link.
ElementLinkBase(const ID_type &dataID, CLID link_clid, index_type elemID, IProxyDict *sg)
Construct a link from a string key and an index.
void reset()
Reset the link to a null state.
ElementLinkBase & operator=(const ElementLinkBase &)=default
const stored_index_type & storedIndex() const
Return the stored representation of the link index.
bool toIndexedElement(const_pointer_t obj, CLID link_clid, index_type elemID, IProxyDict *sg)
Set the link to an element given by index and pointer to container.
void resetWithKeyAndIndex(sgkey_t key, CLID link_clid, index_type elemID, IProxyDict *sg)
Set the link to an element given by string key and index.
stored_index_type persIndex() const
Return the index of the link.
Manage DataProxy reference in ElementLink/DataLink.
Cached pointer with atomic update.
bool thin(const SG::ThinningCache *thinningCache)
Adjust for thinning.
Base class for ElementLinks to vectors of pointers.
sgkey_t persKey() const
Return the SG key that we reference, as a hash.
ElementLinkBase(const DataLinkBase &dlink, index_type index)
Construct a link from a DataLink and an index.
ElementLinkBase(const ElementLinkBase &)=default
ElementLinkBase(sgkey_t key, CLID link_clid, index_type elemID, IProxyDict *sg)
Construct a link from a hashed key and an index.
const void * ElementType
Generic pointer to an element.
bool hasCachedElement() const
Test to see if this link has a cached element pointer.
Indexing policy for a vector-like container.
bool toTransient(IProxyDict *sg=0)
Finish initialization after link has been read.
uint32_t stored_index_type
The type of the index as it is stored internally.
void clearCachedElement()
Clear the currently-cached element.
SG::DataProxyHolder::sgkey_t sgkey_t
Type of hashed keys.
friend class ElementLinkBase_test
For regression testing.
bool getCachedElement(const T *&elt) const
Retrieve the cached element from the link.
Manage DataProxy reference in ElementLink/DataLink.
Helpers to retrieve the current thinning cache from the event context.
SG::DataProxyHolder::ID_type ID_type
Type of string keys.
uint32_t CLID
The Class ID type.
void setCachedElement(ElementType elt) const
Set the cached element stored in the link, assuming the cached element is null.
static const uint32_t INVALID
Value to mark an invalid index.
CxxUtils::CachedPointer< void > m_element
Transient.
const ID_type & dataID() const
Return the SG key that we reference, as a string.
void * storableBase(castfn_t *castfn, CLID clid, bool isConst) const
Return a pointer to the currently-referenced container object.
ElementLinkBase(const ElementLinkBase &other, index_type elemID)
Construct a link from another link, changing the index.
SG::DataProxyHolder m_proxy
SG proxy for this link.
uint32_t sgkey_t
Type used for hashed StoreGate key+CLID pairs.
void resetWithKeyAndIndex(const ID_type &dataID, CLID link_clid, index_type elemID, IProxyDict *sg)
Set the link to an element given by string key and index.
IProxyDict * source() const
Return the data source for this reference.
ElementLinkBase()
Default constructor.
ElementLinkBase(sgkey_t key, CLID link_clid, index_type elemID, const void *elt, IProxyDict *sg)
Construct a link from a hashed key, index, AND pointer to element.
ElementLinkBase(const ID_type &dataID, CLID link_clid, index_type elemID, const void *elt, IProxyDict *sg)
Construct a link from a string key, index, AND pointer to element.
Define the type used for hashed StoreGate key+CLID pairs.
void setIndex(index_type index)
Set the index part of the link.
const void * const_pointer_t
void * castfn_t(SG::DataProxy *)
Function casting from a SG::DataProxy to a pointer.
bool toPersistent()
Prepare this link for writing.
sgkey_t key() const
Return the SG key that we reference, as a hash.
ElementLinkBase(const_pointer_t obj, CLID link_clid, index_type elemID, IProxyDict *sg)
Construct a link from an index and pointer to the container.
ElementLinkBase(const ElementLinkBase &other, FROM_TRAITS *, TO_TRAITS *)
Constructor from a link referencing a different type.
IStringPool::sgkey_t sgkey_t
Type of hashed keys.
stored_index_type m_persIndex
The index of the element within the container for this link.
const SG::DataProxy * proxy() const
Return the SG proxy for the container holding this element.
Cache thinning decisions for converters.
bool isDefaultIndex() const
Test the index validity.
bool setStorableObject(const_pointer_t data, CLID link_clid, bool replace, IProxyDict *sg)
Set the container referenced by the link to data.
bool isDefault() const
Test to see if this link is in the default state.
bool thin()
Adjust for thinning.
SG::sgkey_t m_persKey
The hashed key for this link.
Type-independent part of DataLink; holds the persistent state.
index_type index() const
Return the index of the link.
std::string ID_type
Type of string keys.
size_t index_type
The index type presented to and returned from the link.