ATLAS Offline Software
Public Types | Public Member Functions | Public Attributes | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | Friends | List of all members
SG::GenericElementLinkBase< INDEXING_POLICY > Struct Template Reference

Generic base class for ElementLinks. More...

#include <DataLinkBase.h>

Inherited by ElementLink< STORABLE >, ElementLink< Analysis::MuonContainer >, ElementLink< AthExParticles >, ElementLink< CaloCellContainer >, ElementLink< CaloCellLinkContainer >, ElementLink< CaloClusterCellLinkContainer >, ElementLink< CaloClusterContainer >, ElementLink< CaloRingsContainer >, ElementLink< CaloShowerContainer >, ElementLink< CONT >, ElementLink< CONTAINER >, ElementLink< Container >, ElementLink< DataVector >, ElementLink< DataVector< Muon::MuonPatternCombination > >, ElementLink< DataVector< Trk::Track > >, ElementLink< DOBJ >, ElementLink< egammaContainer >, ElementLink< ElectronContainer >, ElementLink< EMShowerMinimalContainer >, ElementLink< ExampleHitContainer >, ElementLink< INavigable4MomentumCollection >, ElementLink< InDet::PixelClusterContainer >, ElementLink< InDet::SCT_ClusterContainer >, ElementLink< InDet::TRT_DriftCircleContainer >, ElementLink< IParticleContainer >, ElementLink< JetCollection >, ElementLink< MasterContainer_t >, ElementLink< McEventCollection >, ElementLink< Muon::CscPrepDataContainer >, ElementLink< Muon::MdtPrepDataContainer >, ElementLink< Muon::MMPrepDataContainer >, ElementLink< Muon::RpcPrepDataContainer >, ElementLink< Muon::sTgcPrepDataContainer >, ElementLink< Muon::TgcPrepDataContainer >, ElementLink< MuonCaloEnergyContainer >, ElementLink< MuonFeatureContainer >, ElementLink< MVFVxContainer >, ElementLink< PhotonContainer >, ElementLink< Rec::MuonSpShowerContainer >, ElementLink< Rec::TrackParticleContainer >, ElementLink< RingerRingsContainer >, ElementLink< std::vector< SGTutorial::MyElement > >, ElementLink< T >, ElementLink< TBADCRawCont >, ElementLink< TBTDCRawCont >, ElementLink< TileMuFeatureContainer >, ElementLink< TrackCollection >, ElementLink< TrackParticleBaseCollection >, ElementLink< TrigEFBphysContainer >, ElementLink< TrigEMClusterContainer >, ElementLink< TrigInDetTrackCollection >, ElementLink< TrigL2BphysContainer >, ElementLink< TrigMuonEFInfoContainer >, ElementLink< TrigRoiDescriptorCollection >, ElementLink< TrigTauClusterDetailsContainer >, ElementLink< Trk::PrepRawDataContainer >, ElementLink< TruthEtIsolationsContainer >, ElementLink< TruthParticleContainer >, ElementLink< V0Container >, ElementLink< VxContainer >, ElementLink< xAOD::IParticleContainer >, ElementLink< xAOD::MissingETContainer_v1 >, ElementLink< xAOD::NeutralParticleContainer >, and ElementLink< xAOD::TrackParticleContainer >.

Collaboration diagram for SG::GenericElementLinkBase< INDEXING_POLICY >:

Public Types

typedef INDEXING_POLICY::index_type index_type
 The index type presented to and returned from the link. More...
 
typedef INDEXING_POLICY::stored_index_type stored_index_type
 The type of the index as it is stored internally. More...
 
typedef SG::DataProxyHolder::sgkey_t sgkey_t
 Type of hashed keys. More...
 
typedef SG::DataProxyHolder::ID_type ID_type
 Type of string keys. More...
 
typedef void * castfn_t(SG::DataProxy *)
 Function casting from a SG::DataProxy to a pointer. More...
 
typedef GenericElementLinkBase< INDEXING_POLICY > self
 

Public Member Functions

bool isDefaultIndex () const
 Test the index validity. More...
 
bool hasCachedElement () const
 Test to see if this link has a cached element pointer. More...
 
bool isDefault () const
 Test to see if this link is in the default state. More...
 
index_type index () const
 Return the index of the link. More...
 
const ID_typedataID () const
 Return the SG key that we reference, as a string. More...
 
sgkey_t key () const
 Return the SG key that we reference, as a hash. More...
 
IProxyDictsource () const
 Return the data source for this reference. More...
 
const SG::DataProxyproxy () const
 Return the SG proxy for the container holding this element. More...
 
void reset ()
 Reset the link to a null state. More...
 
bool toTransient (IProxyDict *sg=0)
 Finish initialization after link has been read. More...
 
bool toPersistent ()
 Prepare this link for writing. More...
 
bool thin ()
 Adjust for thinning. More...
 
bool thin (const SG::ThinningCache *thinningCache)
 Adjust for thinning. More...
 

Public Attributes

ROOT_SELECTION_NS::TRANSIENT m_proxy
 
ROOT_SELECTION_NS::TRANSIENT m_cacheValid
 
ROOT_SELECTION_NS::TRANSIENT m_element
 

Protected Member Functions

 GenericElementLinkBase ()
 Default constructor. More...
 
 GenericElementLinkBase (const ID_type &dataID, CLID link_clid, const index_type &elemID, IProxyDict *sg)
 Construct a link from a string key and an index. More...
 
 GenericElementLinkBase (sgkey_t key, CLID link_clid, const index_type &elemID, IProxyDict *sg)
 Construct a link from a hashed key and an index. More...
 
 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. More...
 
 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. More...
 
 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. More...
 
 GenericElementLinkBase (const GenericElementLinkBase &other, const index_type &elemID)
 Construct a link from another link, changing the index. More...
 
 GenericElementLinkBase (const DataLinkBase &dlink, const index_type &index)
 Construct a link from a DataLink and an index. More...
 
template<class OTHER_INDEXING_POLICY , class FROM_TRAITS , class TO_TRAITS >
 GenericElementLinkBase (const GenericElementLinkBase< OTHER_INDEXING_POLICY > &other, FROM_TRAITS *, TO_TRAITS *)
 Constructor from a link referencing a different type. More...
 
 GenericElementLinkBase (const GenericElementLinkBase &)=default
 
GenericElementLinkBaseoperator= (const GenericElementLinkBase &)=default
 
void * storableBase (castfn_t *castfn, const CLID &clid, bool isConst) const
 Return a pointer to the currently-referenced container object. More...
 
bool setStorableObject (const_pointer_t data, CLID link_clid, bool replace, IProxyDict *sg)
 Set the container referenced by the link to data. More...
 
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. More...
 
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. More...
 
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. More...
 
void setIndex (const index_type &index)
 Set the index part of the link. More...
 
const stored_index_typestoredIndex () const
 Return the stored representation of the link index. More...
 
void setCachedElement (const ElementType &elt) const
 Set the cached element stored in the link. More...
 
void storeCachedElement (const ElementType &elt)
 Set the cached element stored in the link. More...
 
bool getCachedElement (ElementConstPointer &elt) const
 Retrieve the cached element from the link. More...
 
const SG::DataProxyHolderproxyHolder () const
 Return the internal proxy holder object. More...
 

Private Types

typedef INDEXING_POLICY::ElementType ElementType
 Generic pointer to an element. More...
 
typedef INDEXING_POLICY::ElementConstPointer ElementConstPointer
 
typedef SG::DataProxyHolder::const_pointer_t const_pointer_t
 Generic pointer to the container (storable). More...
 
typedef ROOT_SELECTION_NS::SG::GenericElementLinkBase< INDEXING_POLICY >::self DictSel
 Transient. More...
 

Private Member Functions

template<class INDEX >
 requires (std::convertible_to< INDEX, size_t > &&std::convertible_to< size_t, INDEX >) bool thin1(INDEX &persIndex
 Adjust for thinning. More...
 
template<class INDEX >
 requires (!(std::convertible_to< INDEX, size_t > &&std::convertible_to< size_t, INDEX >)) bool thin1(INDEX &persIndex
 Adjust for thinning. More...
 

Private Attributes

const SG::ThinningCachethinningCache
 
SG::sgkey_t m_key
 The hashed key for this link. More...
 
stored_index_type m_index
 The index of the element within the container for this link. More...
 
SG::DataProxyHolder m_proxy
 SG proxy for this link. More...
 
CxxUtils::CachedValue< ElementTypem_element
 Transient. More...
 

Friends

template<class OTHER_POLICY >
class GenericElementLinkBase
 
template<class POLICY >
class ::ElementLinkBaseT_test
 For regression testing. More...
 

Detailed Description

template<class INDEXING_POLICY>
struct SG::GenericElementLinkBase< INDEXING_POLICY >

Generic base class for ElementLinks.

The part of ElementLink that doesn't directly depend on the particular container class is factored out here. We do, however, need to know both the index and element types. We get these from the indexing policy (so we do have an indirect dependence on the container type).

This class holds all the state of the ElementLink. The persistent part is the hashed SG key of the container and the index of the element within the container. We also store a transient DataProxyHolder, which encapsulates the pointer to the DataProxy and factors out code shared with DataLink. Further, we store a (transient and mutable) copy of the element to which this link refers, as well as a flag to tell if the cached element is valid.

The main reason for breaking out the base class like this is that for the common case where the container has vector-like indexing and the element is a pointer type we actually use the non-templated class ElementLinkBase instead of this one. ElementLinkBase is essentially the same as this, but specialized for the case of the index being an unsigned int and the element being a pointer. This factorization makes direct ROOT persistency easier for this common case.

See ElementLinkTraits.h for a summary of the requirements for these base classes.

Definition at line 24 of file AthLinks/DataLinkBase.h.

Member Typedef Documentation

◆ castfn_t

template<class INDEXING_POLICY >
typedef void* SG::GenericElementLinkBase< INDEXING_POLICY >::castfn_t(SG::DataProxy *)

Function casting from a SG::DataProxy to a pointer.

Definition at line 101 of file GenericElementLinkBase.h.

◆ const_pointer_t

template<class INDEXING_POLICY >
typedef SG::DataProxyHolder::const_pointer_t SG::GenericElementLinkBase< INDEXING_POLICY >::const_pointer_t
private

Generic pointer to the container (storable).

Definition at line 84 of file GenericElementLinkBase.h.

◆ DictSel

template<class INDEXING_POLICY >
typedef ROOT_SELECTION_NS::SG::GenericElementLinkBase<INDEXING_POLICY>::self SG::GenericElementLinkBase< INDEXING_POLICY >::DictSel
private

Transient.

Connect to selection rules.

Definition at line 549 of file GenericElementLinkBase.h.

◆ ElementConstPointer

template<class INDEXING_POLICY >
typedef INDEXING_POLICY::ElementConstPointer SG::GenericElementLinkBase< INDEXING_POLICY >::ElementConstPointer
private

Definition at line 81 of file GenericElementLinkBase.h.

◆ ElementType

template<class INDEXING_POLICY >
typedef INDEXING_POLICY::ElementType SG::GenericElementLinkBase< INDEXING_POLICY >::ElementType
private

Generic pointer to an element.

Definition at line 80 of file GenericElementLinkBase.h.

◆ ID_type

template<class INDEXING_POLICY >
typedef SG::DataProxyHolder::ID_type SG::GenericElementLinkBase< INDEXING_POLICY >::ID_type

Type of string keys.

Definition at line 98 of file GenericElementLinkBase.h.

◆ index_type

template<class INDEXING_POLICY >
typedef INDEXING_POLICY::index_type SG::GenericElementLinkBase< INDEXING_POLICY >::index_type

The index type presented to and returned from the link.

Definition at line 89 of file GenericElementLinkBase.h.

◆ self

template<class INDEXING_POLICY >
typedef GenericElementLinkBase<INDEXING_POLICY> SG::GenericElementLinkBase< INDEXING_POLICY >::self

Definition at line 561 of file GenericElementLinkBase.h.

◆ sgkey_t

template<class INDEXING_POLICY >
typedef SG::DataProxyHolder::sgkey_t SG::GenericElementLinkBase< INDEXING_POLICY >::sgkey_t

Type of hashed keys.

Definition at line 95 of file GenericElementLinkBase.h.

◆ stored_index_type

template<class INDEXING_POLICY >
typedef INDEXING_POLICY::stored_index_type SG::GenericElementLinkBase< INDEXING_POLICY >::stored_index_type

The type of the index as it is stored internally.

Definition at line 92 of file GenericElementLinkBase.h.

Constructor & Destructor Documentation

◆ GenericElementLinkBase() [1/10]

template<class INDEXING_POLICY >
SG::GenericElementLinkBase< INDEXING_POLICY >::GenericElementLinkBase ( )
protected

Default constructor.

Makes a null link.

◆ GenericElementLinkBase() [2/10]

template<class INDEXING_POLICY >
SG::GenericElementLinkBase< INDEXING_POLICY >::GenericElementLinkBase ( const ID_type dataID,
CLID  link_clid,
const index_type elemID,
IProxyDict sg 
)
protected

Construct a link from a string key and an index.

Parameters
dataIDKey of the object.
link_clidCLID of the link being set.
elemIDThe index of the element within the container.
sgAssociated store.

If sg is 0, we take the global default.

◆ GenericElementLinkBase() [3/10]

template<class INDEXING_POLICY >
SG::GenericElementLinkBase< INDEXING_POLICY >::GenericElementLinkBase ( sgkey_t  key,
CLID  link_clid,
const index_type elemID,
IProxyDict sg 
)
protected

Construct a link from a hashed key and an index.

Parameters
keyHashed key of the object.
link_clidCLID of the link being set.
elemIDThe index of the element within the container.
sgAssociated store.

If sg is 0, we take the global default.

◆ GenericElementLinkBase() [4/10]

template<class INDEXING_POLICY >
SG::GenericElementLinkBase< INDEXING_POLICY >::GenericElementLinkBase ( const ID_type dataID,
CLID  link_clid,
const index_type elemID,
const ElementType elt,
IProxyDict sg 
)
protected

Construct a link from a string key, index, AND pointer to element.

Parameters
dataIDKey of the object.
link_clidCLID of the link being set.
elemIDThe index of the element within the container.
eltPointer to the element.
sgAssociated store.

USE CAREFULLY: no coherency checks, we just trust you!

If sg is 0, we take the global default.

◆ GenericElementLinkBase() [5/10]

template<class INDEXING_POLICY >
SG::GenericElementLinkBase< INDEXING_POLICY >::GenericElementLinkBase ( sgkey_t  key,
CLID  link_clid,
const index_type elemID,
const ElementType elt,
IProxyDict sg 
)
protected

Construct a link from a hashed key, index, AND pointer to element.

Parameters
keyHashed key of the object.
link_clidCLID of the link being set.
elemIDThe index of the element within the container.
eltPointer to the element.
sgAssociated store.

USE CAREFULLY: no coherency checks, we just trust you!

If sg is 0, we take the global default.

◆ GenericElementLinkBase() [6/10]

template<class INDEXING_POLICY >
SG::GenericElementLinkBase< INDEXING_POLICY >::GenericElementLinkBase ( const_pointer_t  obj,
CLID  link_clid,
const index_type elemID,
IProxyDict sg 
)
protected

Construct a link from an index and pointer to the container.

Parameters
objPointer to the container (storable).
link_clidCLID of the link being set.
elemIDThe index of the element within the container.
sgAssociated store.

If sg is 0, we take the global default.

◆ GenericElementLinkBase() [7/10]

template<class INDEXING_POLICY >
SG::GenericElementLinkBase< INDEXING_POLICY >::GenericElementLinkBase ( const GenericElementLinkBase< INDEXING_POLICY > &  other,
const index_type elemID 
)
protected

Construct a link from another link, changing the index.

Parameters
otherThe source link.
elemIDThe index for the new link.

The index being constructed will reference the same container as other, but it will refer to element elemID.

◆ GenericElementLinkBase() [8/10]

template<class INDEXING_POLICY >
SG::GenericElementLinkBase< INDEXING_POLICY >::GenericElementLinkBase ( const DataLinkBase dlink,
const index_type index 
)
protected

Construct a link from a DataLink and an index.

Parameters
dlinkLink to the container.
indexThe index of the element within the container.

◆ GenericElementLinkBase() [9/10]

template<class INDEXING_POLICY >
template<class OTHER_INDEXING_POLICY , class FROM_TRAITS , class TO_TRAITS >
SG::GenericElementLinkBase< INDEXING_POLICY >::GenericElementLinkBase ( const GenericElementLinkBase< OTHER_INDEXING_POLICY > &  other,
FROM_TRAITS *  ,
TO_TRAITS *   
)
protected

Constructor from a link referencing a different type.

Parameters
otherThe object from which to copy.

FROM_TRAITS is the ElementLinkTraits class for other; TO_TRAITS is the traits class for this object. The actual pointer values are not used, just the types are used. Default conversions for the storable pointer (i.e., derived->base) are allowed.

◆ GenericElementLinkBase() [10/10]

template<class INDEXING_POLICY >
SG::GenericElementLinkBase< INDEXING_POLICY >::GenericElementLinkBase ( const GenericElementLinkBase< INDEXING_POLICY > &  )
protecteddefault

Member Function Documentation

◆ dataID()

template<class INDEXING_POLICY >
const ID_type& SG::GenericElementLinkBase< INDEXING_POLICY >::dataID ( ) const

Return the SG key that we reference, as a string.

Returns a null string on failure.

◆ getCachedElement()

template<class INDEXING_POLICY >
bool SG::GenericElementLinkBase< INDEXING_POLICY >::getCachedElement ( ElementConstPointer elt) const
protected

Retrieve the cached element from the link.

Parameters
elt[out]The cached element.
Returns
True if an element was cached; false otherwise.

elt is left unmodified if there is no cached element.

◆ hasCachedElement()

template<class INDEXING_POLICY >
bool SG::GenericElementLinkBase< INDEXING_POLICY >::hasCachedElement ( ) const

Test to see if this link has a cached element pointer.

◆ index()

template<class INDEXING_POLICY >
index_type SG::GenericElementLinkBase< INDEXING_POLICY >::index ( ) const

Return the index of the link.

◆ isDefault()

template<class INDEXING_POLICY >
bool SG::GenericElementLinkBase< INDEXING_POLICY >::isDefault ( ) const

Test to see if this link is in the default state.

◆ isDefaultIndex()

template<class INDEXING_POLICY >
bool SG::GenericElementLinkBase< INDEXING_POLICY >::isDefaultIndex ( ) const

Test the index validity.

Returns
True if the index is not valid (in default state).

◆ key()

template<class INDEXING_POLICY >
sgkey_t SG::GenericElementLinkBase< INDEXING_POLICY >::key ( ) const

Return the SG key that we reference, as a hash.

Returns 0 on failure.

◆ operator=()

template<class INDEXING_POLICY >
GenericElementLinkBase& SG::GenericElementLinkBase< INDEXING_POLICY >::operator= ( const GenericElementLinkBase< INDEXING_POLICY > &  )
protecteddefault

◆ proxy()

template<class INDEXING_POLICY >
const SG::DataProxy* SG::GenericElementLinkBase< INDEXING_POLICY >::proxy ( ) const

Return the SG proxy for the container holding this element.

If this is a null link, we return 0. If we're directly referencing an object that's not in StoreGate, either return 0 or throw ExcPointerNotInSG, depending on nothrow. Otherwise, return the proxy for the object we're referencing.

◆ proxyHolder()

template<class INDEXING_POLICY >
const SG::DataProxyHolder& SG::GenericElementLinkBase< INDEXING_POLICY >::proxyHolder ( ) const
protected

Return the internal proxy holder object.

◆ requires() [1/2]

template<class INDEXING_POLICY >
template<class INDEX >
SG::GenericElementLinkBase< INDEXING_POLICY >::requires ( std::convertible_to< INDEX, size_t > && std::convertible_to< size_t, INDEX >) &
private

Adjust for thinning.

If this link points to a container that has been thinned, it will be adjusted accordingly.

Parameters
Indexof the element.
thinningCacheThinning cache for the current stream (may be null).

Returns true if the link was changed; false otherwise.

This overload will be used for the case where thinning is not supported.

◆ requires() [2/2]

template<class INDEXING_POLICY >
template<class INDEX >
SG::GenericElementLinkBase< INDEXING_POLICY >::requires ( std::convertible_to< INDEX, size_t > &&std::convertible_to< size_t, INDEX >  ) &
private

Adjust for thinning.

If this link points to a container that has been thinned, it will be adjusted accordingly.

Parameters
Indexof the element.
thinningCacheThinning cache for the current stream (may be null).

Returns true if the link was changed; false otherwise.

This overload will be used for the case where thinning is supported: the index can be interconverted with size_t.

◆ reset()

template<class INDEXING_POLICY >
void SG::GenericElementLinkBase< INDEXING_POLICY >::reset ( )

Reset the link to a null state.

◆ resetWithKeyAndIndex() [1/2]

template<class INDEXING_POLICY >
void SG::GenericElementLinkBase< INDEXING_POLICY >::resetWithKeyAndIndex ( const ID_type dataID,
CLID  link_clid,
const index_type elemID,
IProxyDict sg 
)
protected

Set the link to an element given by string key and index.

Parameters
dataIDKey of the object.
link_clidCLID of the link being set.
elemIDThe index of the element within the container.
sgAssociated store.

If sg is 0, then we take the store from whatever the link's currently set to. If the link has no current store, then we take the global default.

◆ resetWithKeyAndIndex() [2/2]

template<class INDEXING_POLICY >
void SG::GenericElementLinkBase< INDEXING_POLICY >::resetWithKeyAndIndex ( sgkey_t  key,
CLID  link_clid,
const index_type elemID,
IProxyDict sg 
)
protected

Set the link to an element given by string key and index.

Parameters
keyHashed key of the object.
link_clidCLID of the link being set.
elemIDThe index of the element within the container.
sgAssociated store.

If sg is 0, then we take the store from whatever the link's currently set to. If the link has no current store, then we take the global default.

◆ setCachedElement()

template<class INDEXING_POLICY >
void SG::GenericElementLinkBase< INDEXING_POLICY >::setCachedElement ( const ElementType elt) const
protected

Set the cached element stored in the link.

Parameters
eltNew value for the cached element.

◆ setIndex()

template<class INDEXING_POLICY >
void SG::GenericElementLinkBase< INDEXING_POLICY >::setIndex ( const index_type index)
protected

Set the index part of the link.

Parameters
indexNew index value.

◆ setStorableObject()

template<class INDEXING_POLICY >
bool SG::GenericElementLinkBase< INDEXING_POLICY >::setStorableObject ( const_pointer_t  data,
CLID  link_clid,
bool  replace,
IProxyDict sg 
)
protected

Set the container referenced by the link to data.

Parameters
dataPointer to the new container.
link_clidCLID of the link being set.
replaceTrue if we can change an existing link.
sgAssociated store.
Returns
True if the link was changed.

If the link is already set, this will return false and leave the link unchanged unless replace is set. The replace argument should be set if the element is now in a new storable container; e.g. element ptr has been put in a new view container.

If sg is 0, then we take the store from whatever the link's currently set to. If the link has no current store, then we take the global default.

◆ source()

template<class INDEXING_POLICY >
IProxyDict* SG::GenericElementLinkBase< INDEXING_POLICY >::source ( ) const

Return the data source for this reference.

◆ storableBase()

template<class INDEXING_POLICY >
void* SG::GenericElementLinkBase< INDEXING_POLICY >::storableBase ( castfn_t castfn,
const CLID clid,
bool  isConst 
) const
protected

Return a pointer to the currently-referenced container object.

Parameters
castfnFunction to do the cast from data proxy to object. If 0, use a dynamic cast.
clidThe CLID of the desired object. This is used to determine how the returned pointer is to be converted.
isConstTrue if the returned object will be treated as const.
Returns
A pointer to an object of the type given by clid, or null on a failure (or if the reference is null).

◆ storeCachedElement()

template<class INDEXING_POLICY >
void SG::GenericElementLinkBase< INDEXING_POLICY >::storeCachedElement ( const ElementType elt)
protected

Set the cached element stored in the link.

Parameters
eltNew value for the cached element.

◆ storedIndex()

template<class INDEXING_POLICY >
const stored_index_type& SG::GenericElementLinkBase< INDEXING_POLICY >::storedIndex ( ) const
protected

Return the stored representation of the link index.

◆ thin() [1/2]

template<class INDEXING_POLICY >
bool SG::GenericElementLinkBase< INDEXING_POLICY >::thin ( )

Adjust for thinning.

If this link points to a container that has been thinned, it will be adjusted accordingly.

Returns true if the link was changed; false otherwise.

◆ thin() [2/2]

template<class INDEXING_POLICY >
bool SG::GenericElementLinkBase< INDEXING_POLICY >::thin ( const SG::ThinningCache thinningCache)

Adjust for thinning.

If this link points to a container that has been thinned, it will be adjusted accordingly.

Parameters
thinningCacheThinning cache for the current stream (may be null).

Returns true if the link was changed; false otherwise.

◆ toIndexedElement()

template<class INDEXING_POLICY >
bool SG::GenericElementLinkBase< INDEXING_POLICY >::toIndexedElement ( const_pointer_t  obj,
CLID  link_clid,
const index_type elemID,
IProxyDict sg 
)
protected

Set the to an element given by index and pointer to container.

Parameters
objPointer to the container (storable).
link_clidCLID of the link being set.
elemIDThe index of the element within the container.
sgAssociated store.
Returns
True if the link was changed.

If the link is already set, this will return false and leave the link unchanged.

If sg is 0, then we take the store from whatever the link's currently set to. If the link has no current store, then we take the global default.

◆ toPersistent()

template<class INDEXING_POLICY >
bool SG::GenericElementLinkBase< INDEXING_POLICY >::toPersistent ( )

Prepare this link for writing.

This method should be called before trying to write the link with root. It will make sure the persistent fields of the link are valid. It will also perform remapping if needed.

Will return true on success. Will return false if either the container or the element index has not been specified. Will throw ExcPointerNotInSG if the link is referencing a container that is not in SG.

◆ toTransient()

template<class INDEXING_POLICY >
bool SG::GenericElementLinkBase< INDEXING_POLICY >::toTransient ( IProxyDict sg = 0)

Finish initialization after link has been read.

Parameters
sgAssociated store.

This should be called after a link has been read by root in order to set the proxy pointer. Returns true.

If sg is 0, then we use the global default store.

Friends And Related Function Documentation

◆ ::ElementLinkBaseT_test

template<class INDEXING_POLICY >
template<class POLICY >
friend class ::ElementLinkBaseT_test
friend

For regression testing.

Definition at line 532 of file GenericElementLinkBase.h.

◆ GenericElementLinkBase

template<class INDEXING_POLICY >
template<class OTHER_POLICY >
friend class GenericElementLinkBase
friend

Definition at line 528 of file GenericElementLinkBase.h.

Member Data Documentation

◆ m_cacheValid

template<class INDEXING_POLICY >
ROOT_SELECTION_NS::TRANSIENT SG::GenericElementLinkBase< INDEXING_POLICY >::m_cacheValid

Definition at line 563 of file GenericElementLinkBase.h.

◆ m_element [1/2]

template<class INDEXING_POLICY >
CxxUtils::CachedValue<ElementType> SG::GenericElementLinkBase< INDEXING_POLICY >::m_element
private

Transient.

Cached element.

Definition at line 544 of file GenericElementLinkBase.h.

◆ m_element [2/2]

template<class INDEXING_POLICY >
ROOT_SELECTION_NS::TRANSIENT SG::GenericElementLinkBase< INDEXING_POLICY >::m_element

Definition at line 564 of file GenericElementLinkBase.h.

◆ m_index

template<class INDEXING_POLICY >
stored_index_type SG::GenericElementLinkBase< INDEXING_POLICY >::m_index
private

The index of the element within the container for this link.

Definition at line 538 of file GenericElementLinkBase.h.

◆ m_key

template<class INDEXING_POLICY >
SG::sgkey_t SG::GenericElementLinkBase< INDEXING_POLICY >::m_key
private

The hashed key for this link.

Definition at line 535 of file GenericElementLinkBase.h.

◆ m_proxy [1/2]

template<class INDEXING_POLICY >
SG::DataProxyHolder SG::GenericElementLinkBase< INDEXING_POLICY >::m_proxy
private

SG proxy for this link.

Definition at line 541 of file GenericElementLinkBase.h.

◆ m_proxy [2/2]

template<class INDEXING_POLICY >
ROOT_SELECTION_NS::TRANSIENT SG::GenericElementLinkBase< INDEXING_POLICY >::m_proxy

Definition at line 562 of file GenericElementLinkBase.h.

◆ thinningCache

template<class INDEXING_POLICY >
const SG::ThinningCache * SG::GenericElementLinkBase< INDEXING_POLICY >::thinningCache
private

Definition at line 505 of file GenericElementLinkBase.h.


The documentation for this struct was generated from the following files: