ATLAS Offline Software
|
Helper functions for managing PackedLink
variables.
More...
#include <PackedLinkVectorHelper.h>
Classes | |
class | LinkedVector |
Helper to access the IAuxTypeVector for an aux variable. More... | |
Public Types | |
using | DataLinkBase = ::DataLinkBase |
typedef void | InitLinkFunc_t(DataLinkBase &dl, sgkey_t sgkey, IProxyDict *sg) |
Function to initialize a DataLink to a given hashed key. More... | |
using | DataLinkBase_span = detail::AuxDataSpan< DataLinkBase > |
Spans over the linked DataLinks . More... | |
using | const_DataLinkBase_span = detail::AuxDataConstSpan< DataLinkBase > |
using | PackedLinkBase_span = CxxUtils::span< PackedLinkBase > |
Span over links. More... | |
Static Public Member Functions | |
static IProxyDict * | storeFromSpan (DataLinkBase_span &links) |
Return the current store from the first valid link in the span. More... | |
static DataLinkBase_span | getLinkBaseSpan (IAuxTypeVector &linkedVec) |
Return a span over all the linked DataLinkBase's , from the linked vector. More... | |
static const_DataLinkBase_span | getLinkBaseSpan (const IAuxTypeVector &linkedVec) |
Return a span over all the linked DataLinks. More... | |
static std::pair< size_t, bool > | findCollectionBase (LinkedVector &linkedVec, sgkey_t sgkey, DataLinkBase_span &links, IProxyDict *sg, InitLinkFunc_t *initLinkFunc) |
Find the collection index in the linked DataLinks for a sgkey. More... | |
static bool | updateLinksBase (IAuxTypeVector &linkedVec, PackedLinkBase_span &links, const const_DataLinkBase_span &srcDLinks, IProxyDict *sg, InitLinkFunc_t *initLinkFunc) |
Update collection index of a collection of PackedLink . More... | |
static bool | applyThinningBase (IAuxTypeVector &linkedVec, PackedLinkBase_span &links, DataLinkBase_span &dlinks, const SG::ThinningCache *tc, IProxyDict *sg, InitLinkFunc_t *initLinkFunc) |
Apply thinning to packed links, to prepare them for output. More... | |
Static Private Member Functions | |
static bool | resizeLinks (LinkedVector &linkedVec, size_t sz) |
Resize a linked vector of DataLinks . More... | |
Helper functions for managing PackedLink
variables.
Functions that don't depend on the target type.
Definition at line 43 of file PackedLinkVectorHelper.h.
using SG::detail::PackedLinkVectorHelperBase::const_DataLinkBase_span = detail::AuxDataConstSpan<DataLinkBase> |
Definition at line 70 of file PackedLinkVectorHelper.h.
Definition at line 57 of file PackedLinkVectorHelper.h.
Spans over the linked DataLinks
.
These hold the span data by reference, so they update if the underlying vector changes.
Definition at line 69 of file PackedLinkVectorHelper.h.
typedef void SG::detail::PackedLinkVectorHelperBase::InitLinkFunc_t(DataLinkBase &dl, sgkey_t sgkey, IProxyDict *sg) |
Function to initialize a DataLink
to a given hashed key.
Definition at line 61 of file PackedLinkVectorHelper.h.
Span over links.
Definition at line 127 of file PackedLinkVectorHelper.h.
|
static |
Apply thinning to packed links, to prepare them for output.
linkedVec | Interface for the linked vector of DataLinks . |
links | Span over the links to update, as PackedLinkBase . |
dlinks | Span over the source link vector, as DataLinkBase . |
tc | The ThinningCache for this object, if it exists. |
sg | The IProxyDict of the current store. If null, take it from the links in srcDlinks , or use the global, thread-local default. |
initFunc | Function to initialize a DataLink to a given hashed key. |
Returns true if it is known that the payload of the linked vector has not moved. (If this is false, any caches/iterators must be assumed to be invalid.)
Definition at line 130 of file PackedLinkVectorHelper.cxx.
|
static |
Find the collection index in the linked DataLinks
for a sgkey.
linkedVec | How to find the linked vector. |
sgkey | Hashed key for which to search. |
links | Span over the vector of DataLinks , as DataLinkBase . May be modified if the vector grows. |
sg | The IProxyDict of the current store. May be null to use the global, thread-local default. |
initFunc | Function to initialize a DataLink to a given hashed key. |
Searches for a DataLinkBase
matching sgkey
in the linked vector. If not found, then a new entry is added. Returns a pair (INDEX, CACHEVALID). INDEX is the index in the vector of the sgkey (and thus the collection index to store in the PackedLink
). CACHEVALID is true if it is known that the payload of the vector has not moved. (If this is false, any caches/iterators must be assumed to be invalid.)
This does not actually initialize the DataLink
if the vector grows. The caller should test if the size of the span changed and if so, initialize the last element using sgkey
.
Definition at line 42 of file PackedLinkVectorHelper.cxx.
|
static |
Return a span over all the linked DataLinks.
from the linked vector.
linkedVec | Interface for the linked vector of DataLinks. |
|
static |
Return a span over all the linked DataLinkBase's
, from the linked vector.
linkedVec | Interface for the linked vector of DataLinkBase's . |
|
staticprivate |
Resize a linked vector of DataLinks
.
linkedVec | How to find the linked vector. |
sz | The new size of the container. |
Returns true if it is known the the underlying vector did not move.
Definition at line 171 of file PackedLinkVectorHelper.cxx.
|
static |
Return the current store from the first valid link in the span.
If there are no valid links, then return the global default.
links | The span of links. |
|
static |
Update collection index of a collection of PackedLink
.
linkedVec | Interface for the linked vector of DataLinks . |
links | Span over the links to update, as PackedLinkBase . |
srcDLinks | Span over the source link vector, as DataLinkBase . |
sg | The IProxyDict of the current store. If null, take it from the links in srcDlinks , or use the global, thread-local default. |
initFunc | Function to initialize a DataLink to a given hashed key. |
To be used after links have been copied/moved from one container to another. The collection indices are updated to be appropriate for the destination container. Returns true if it is known that the payload of the linked vector has not moved. (If this is false, any caches/iterators must be assumed to be invalid.)
Definition at line 87 of file PackedLinkVectorHelper.cxx.