ATLAS Offline Software
|
Helper functions for managing PackedLink
variables.
More...
#include <PackedLinkVectorHelper.h>
Public Types | |
using | Link_t = ElementLink< CONT > |
The (linked) data links. More... | |
using | DLink_t = DataLink< CONT > |
using | DataLink_span = detail::AuxDataSpan< DataLink< CONT > > |
using | const_DataLink_span = detail::AuxDataConstSpan< DataLink< CONT > > |
using | PLink_t = PackedLink< CONT > |
The PackedLinks. More... | |
using | PackedLink_span = CxxUtils::span< PLink_t > |
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 std::pair< size_t, bool > | findCollection (LinkedVector &linkedVec, sgkey_t sgkey, DataLinkBase_span &links, IProxyDict *sg) |
Find the collection index in the linked DataLinks for a sgkey. More... | |
static bool | updateLinks (IAuxTypeVector &linkedVec, SG::PackedLink< CONT > *ptr, size_t n, const const_DataLinkBase_span &srcDLinks, IProxyDict *sg) |
Update collection index of a collection of PackedLink . More... | |
static bool | updateLinks (IAuxTypeVector &linkedVec, SG::PackedLink< CONT > *ptr, size_t n, const IAuxTypeVector &srclv, IProxyDict *sg) |
Update collection index of a collection of PackedLink . More... | |
template<class VALLOC > | |
static bool | updateLinks (IAuxTypeVector &linkedVec, std::vector< SG::PackedLink< CONT >, VALLOC > *ptr, size_t n, const IAuxTypeVector &srclv, IProxyDict *sg) |
Update collection index of a collection of PackedLink vectors. More... | |
template<class VALLOC , ElementLinkRange< CONT > RANGE> | |
static bool | assignVElt (std::vector< PLink_t, VALLOC > &velt, IAuxTypeVector &linkedVec, DataLinkBase_span &dlinks, const RANGE &x) |
Assign a range of ElementLink to a vector of Packedlink . More... | |
template<class VALLOC , ElementLinkRange< CONT > RANGE> | |
static bool | insertVElt (std::vector< PLink_t, VALLOC > &velt, size_t pos, IAuxTypeVector &linkedVec, DataLinkBase_span &dlinks, const RANGE &x) |
Insert a range of ElementLink into a vector of Packedlink . More... | |
static bool | applyThinning (IAuxTypeVector &linkedVec, PackedLink< CONT > *ptr, size_t n, DataLinkBase_span &dlinks, const SG::ThinningCache *tc, IProxyDict *sg) |
Apply thinning to packed links, to prepare them for output. More... | |
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 void | initLink (DataLinkBase &dl, sgkey_t sgkey, IProxyDict *sg) |
Initialize a DataLink . More... | |
static bool | resizeLinks (LinkedVector &linkedVec, size_t sz) |
Resize a linked vector of DataLinks . More... | |
Helper functions for managing PackedLink
variables.
The template argument is the target type of the links.
Definition at line 254 of file PackedLinkVectorHelper.h.
using SG::detail::PackedLinkVectorHelper< CONT >::const_DataLink_span = detail::AuxDataConstSpan<DataLink<CONT> > |
Definition at line 262 of file PackedLinkVectorHelper.h.
|
inherited |
Definition at line 70 of file PackedLinkVectorHelper.h.
using SG::detail::PackedLinkVectorHelper< CONT >::DataLink_span = detail::AuxDataSpan<DataLink<CONT> > |
Definition at line 261 of file PackedLinkVectorHelper.h.
|
inherited |
Definition at line 57 of file PackedLinkVectorHelper.h.
|
inherited |
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.
using SG::detail::PackedLinkVectorHelper< CONT >::DLink_t = DataLink<CONT> |
Definition at line 260 of file PackedLinkVectorHelper.h.
|
inherited |
Function to initialize a DataLink
to a given hashed key.
Definition at line 61 of file PackedLinkVectorHelper.h.
using SG::detail::PackedLinkVectorHelper< CONT >::Link_t = ElementLink<CONT> |
The (linked) data links.
Definition at line 259 of file PackedLinkVectorHelper.h.
using SG::detail::PackedLinkVectorHelper< CONT >::PackedLink_span = CxxUtils::span<PLink_t> |
Definition at line 266 of file PackedLinkVectorHelper.h.
|
inherited |
Span over links.
Definition at line 127 of file PackedLinkVectorHelper.h.
using SG::detail::PackedLinkVectorHelper< CONT >::PLink_t = PackedLink<CONT> |
The PackedLinks.
Definition at line 265 of file PackedLinkVectorHelper.h.
|
static |
Apply thinning to packed links, to prepare them for output.
linkedVec | Interface for the linked vector of DataLinks . |
ptr | Pointer to the start of the PackedLink collection. |
n | Length of the PackedLink collection. |
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. |
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.)
|
staticinherited |
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 |
Assign a range of ElementLink
to a vector of Packedlink
.
vect | The vector of PackedLink to which to assign. |
linkedVec | Interface for the linked vector of DataLinks. |
dlinks | Span over the link vector, as DataLinkBase . |
x | The range to assign. |
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.)
|
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. May be modified if the vector grows. |
sg | The IProxyDict of the current store. May be null to use the global, thread-local default. |
Searches for a DataLink
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.)
|
staticinherited |
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.
|
staticinherited |
Return a span over all the linked DataLinks.
from the linked vector.
linkedVec | Interface for the linked vector of DataLinks. |
|
staticinherited |
Return a span over all the linked DataLinkBase's
, from the linked vector.
linkedVec | Interface for the linked vector of DataLinkBase's . |
|
staticprivate |
Initialize a DataLink
.
dl | The link to initialize. Really of type DLink_t . |
sgkey | Hashed key to which to initialize the link. |
sg | The IProxyDict of the current store. May be null to use the global, thread-local default. |
|
static |
Insert a range of ElementLink
into a vector of Packedlink
.
vect | The vector of PackedLink to which to assign. |
pos | The position at which to do the insertion. |
linkedVec | Interface for the linked vector of DataLinks. |
dlinks | Span over the link vector, as DataLinkBase . |
x | The range to assign. |
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.)
|
staticprivateinherited |
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.
|
staticinherited |
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. |
ptr | Pointer to the start of the PackedLink collection. |
n | Length of the PackedLink collection. |
srcDLinks | Span over the vector of DataLinks for the source container of the links. |
sg | The IProxyDict of the current store. If null, take it from the links in srcDlinks , or use the global, thread-local default. |
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.)
|
static |
Update collection index of a collection of PackedLink
.
linkedVec | Interface for the linked vector of DataLinks. |
ptr | Pointer to the start of the PackedLink collection. |
n | Length of the PackedLink collection. |
srclv | Interface for the linked vector for the source container of the links. |
sg | The IProxyDict of the current store. If null, take it from the links in srcDlinks , or use the global, thread-local default. |
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.)
|
static |
Update collection index of a collection of PackedLink
vectors.
linkedVec | Interface for the linked vector of DataLinks. |
ptr | Pointer to the start of the PackedLink vector collection. |
n | Length of the PackedLink vector collection. |
srclv | Interface for the linked vector for the source container of the links. |
sg | The IProxyDict of the current store. If null, take it from the links in srcDlinks , or use the global, thread-local default. |
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.)
|
staticinherited |
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.