ATLAS Offline Software
|
Manage index tracking and synchronization of auxiliary data. More...
#include <AuxVectorBase.h>
Classes | |
class | ResortAuxHelper |
Helper to factor out template-independent part of resortAux . More... | |
Public Types | |
template<class T > | |
using | span = typename AuxDataTraits< T >::span |
Spans over auxiliary variables. More... | |
template<class T > | |
using | const_span = typename AuxDataTraits< T >::const_span |
Public Member Functions | |
AuxVectorBase () | |
Default constructor. More... | |
AuxVectorBase (AuxVectorBase &&rhs) | |
Move constructor. More... | |
AuxVectorBase & | operator= (AuxVectorBase &&rhs) |
Move assignment. More... | |
virtual | ~AuxVectorBase () |
Destructor. More... | |
bool | trackIndices () const |
Return true if index tracking is enabled for this container. More... | |
void | setStore (SG::IAuxStore *store) |
Set the store associated with this object. More... | |
void | setStore (const SG::IConstAuxStore *store) |
Set the store associated with this object. More... | |
void | setStore (const DataLink< SG::IConstAuxStore > &store) |
Set the store associated with this object. More... | |
void | setConstStore (const SG::IConstAuxStore *store) |
Synonym for setStore with IConstAuxStore . More... | |
void | setNonConstStore (SG::IAuxStore *store) |
Synonym for setStore with IAuxStore . More... | |
template<class T > | |
bool | isAvailable (const std::string &name, const std::string &clsname="") const |
Test to see if a variable exists in the store. More... | |
template<class T > | |
bool | isAvailableWritable (const std::string &name, const std::string &clsname="") |
Test to see if a variable is available for writing. More... | |
template<class T > | |
bool | isAvailableWritableAsDecoration (const std::string &name, const std::string &clsname="") const |
Test to see if a variable is available for writing as a decoration. More... | |
template<class T > | |
span< T > | getDataSpan (const std::string &name) |
Return a span over an aux data item. More... | |
template<class T > | |
const_span< T > | getDataSpan (const std::string &name) const |
Return a span over an aux data item. More... | |
template<class T > | |
const_span< T > | getConstDataSpan (const std::string &name) const |
Return a span over an aux data item. More... | |
template<class T > | |
span< T > | getDecorationSpan (const std::string &name) const |
Return a span over an aux data item for a decoration. More... | |
bool | isAvailable (auxid_t id) const |
Test to see if a variable exists in the store. More... | |
bool | isAvailableWritable (auxid_t id) |
Test to see if a variable is available for writing. More... | |
bool | isAvailableWritableAsDecoration (auxid_t id) const |
Test to see if a variable is available for writing as a decoration. More... | |
virtual size_t | size_v () const =0 |
Return the size of the container. More... | |
virtual size_t | capacity_v () const =0 |
Return the capacity of the container. More... | |
Static Public Attributes | |
static constexpr bool | supportsThinning = true |
Mark that this type supports thinning operations. More... | |
Protected Member Functions | |
template<class DVL > | |
void | initAuxVectorBase (SG::OwnershipPolicy ownPolicy, SG::IndexTrackingPolicy indexTrackingPolicy) |
Initialize index tracking mode. More... | |
void | swap (AuxVectorBase &other) |
Swap with another container. More... | |
template<class ForwardIterator > | |
void | setIndices (ForwardIterator beg, ForwardIterator end, size_t first=0) |
Set container/index for all elements within a range. More... | |
template<class ForwardIterator > | |
void | clearIndex (ForwardIterator elt) |
Clear the container / index for element elt . More... | |
template<class ForwardIterator > | |
void | clearIndices (ForwardIterator beg, ForwardIterator end) |
Clear the container / index for a range of elements. More... | |
template<class DVL > | |
void | resize (size_t size) |
Resize the aux data associated with this container. More... | |
template<class DVL > | |
void | reserve (size_t size) |
Change the capacity of the aux data associated with this container. More... | |
template<class DVL > | |
void | shift (DVL &cont, size_t pos, ptrdiff_t offs) |
Shift the elements of the container. More... | |
void | moveAux (size_t index, SG::AuxElement *p, bool clear=false, bool skipDestClear=false) |
Set index on an element and copy auxiliary data. More... | |
void | moveAux (size_t index, const void *p, bool clear=false, bool skipDestClear=false) |
Set index on an element and copy auxiliary data. More... | |
template<class ForwardIterator > | |
void | moveAux (size_t index, ForwardIterator beg, ForwardIterator end, bool clear=false, bool skipDestClear=false) |
Set index on a range of elements and copy auxiliary data. More... | |
void | swapElementsAux (size_t aindex, size_t bindex, SG::AuxElement *a, SG::AuxElement *b, AuxVectorBase *bcont) |
Swap indices and auxiliary data between two elements. More... | |
void | swapElementsAux (size_t aindex, size_t bindex, const void *a, const void *b, AuxVectorBase *bcont) |
Swap indices and auxiliary data between two elements. More... | |
template<class ForwardIterator > | |
void | resortAux (size_t index, ForwardIterator beg, ForwardIterator end) |
Reset indices / reorder aux data after elements have been permuted. More... | |
Private Member Functions | |
void | initAuxVectorBase1 (const std::false_type &, SG::OwnershipPolicy, SG::IndexTrackingPolicy) |
Initialize index tracking mode — no-auxdata specialization. More... | |
void | initAuxVectorBase1 (const std::true_type &, SG::OwnershipPolicy ownPolicy, SG::IndexTrackingPolicy indexTrackingPolicy) |
Initialize index tracking mode — auxdata specialization. More... | |
template<class ForwardIterator > | |
void | setIndices1 (const std::false_type &, ForwardIterator beg, ForwardIterator end, size_t first) |
Set container/index for all elements within a range. More... | |
template<class ForwardIterator > | |
void | setIndices1 (const std::true_type &, ForwardIterator beg, ForwardIterator end, size_t first) |
Set container/index for all elements within a range. More... | |
template<class ForwardIterator > | |
void | clearIndex1 (const std::false_type &, ForwardIterator elt) |
Clear the container / index for element elt . More... | |
template<class ForwardIterator > | |
void | clearIndex1 (const std::true_type &, ForwardIterator elt) |
Clear the container / index for element elt . More... | |
template<class ForwardIterator > | |
void | clearIndices1 (const std::false_type &, ForwardIterator, ForwardIterator) |
Clear the container / index for a range of elements. More... | |
template<class ForwardIterator > | |
void | clearIndices1 (const std::true_type &, ForwardIterator beg, ForwardIterator end) |
Clear the container / index for a range of elements. More... | |
void | resize1 (const std::false_type &, size_t size) |
Resize the aux data associated with this container. More... | |
void | resize1 (const std::true_type &, size_t size) |
Resize the aux data associated with this container. More... | |
void | reserve1 (const std::false_type &, size_t size) |
Change the capacity of the aux data associated with this container. More... | |
void | reserve1 (const std::true_type &, size_t size) |
Change the capacity of the aux data associated with this container. More... | |
template<class DVL > | |
void | shift1 (const std::false_type &, DVL &cont, size_t pos, ptrdiff_t offs) |
Shift the elements of the container. More... | |
template<class DVL > | |
void | shift1 (const std::true_type &, DVL &cont, size_t pos, ptrdiff_t offs) |
Shift the elements of the container. More... | |
template<class ForwardIterator > | |
void | moveAux1 (const std::false_type &, size_t index, ForwardIterator beg, ForwardIterator end, bool clear=false, bool skipDestClear=false) |
Set index on a range of elements and copy auxiliary data. More... | |
template<class ForwardIterator > | |
void | moveAux1 (const std::true_type &, size_t index, ForwardIterator beg, ForwardIterator end, bool clear=false, bool skipDestClear=false) |
Set index on a range of elements and copy auxiliary data. More... | |
template<class ForwardIterator > | |
void | resortAux1 (const std::false_type &, size_t index, ForwardIterator beg, ForwardIterator end) |
Reset indices / reorder aux data after elements have been permuted. More... | |
template<class ForwardIterator > | |
void | resortAux1 (const std::true_type &, size_t index, ForwardIterator a, ForwardIterator b) |
Reset indices / reorder aux data after elements have been permuted. More... | |
void * | getDataArrayForResort (SG::auxid_t auxid) |
void | setIndexForResort (SG::AuxElement *elt, size_t idx) |
Private Attributes | |
bool | m_trackIndices |
Flag if index tracking is enabled. More... | |
Friends | |
class | ResortAuxHelper |
Data access. | |
const SG::auxid_set_t & | getAuxIDs () const |
Return a set of identifiers for existing data items in store associated with this object. More... | |
const SG::auxid_set_t & | getDecorIDs () const |
Return a set of identifiers for decorations for this object. More... | |
const SG::auxid_set_t & | getWritableAuxIDs () const |
Return a set of identifiers for writable data items in this store. More... | |
bool | isAvailable (auxid_t id) const |
Test to see if a variable exists in the store. More... | |
bool | isAvailableWritable (auxid_t id) |
Test to see if a variable is available for writing. More... | |
bool | isAvailableWritableAsDecoration (auxid_t id) const |
Test to see if a variable is available for writing as a decoration. More... | |
template<class T > | |
AuxDataTraits< T >::reference_type | getData (SG::auxid_t auxid, size_t ndx) |
Return reference to an aux data item. More... | |
template<class T > | |
AuxDataTraits< T >::const_reference_type | getData (SG::auxid_t auxid, size_t ndx) const |
Return const reference to an aux data item. More... | |
template<class T > | |
AuxDataTraits< T >::reference_type | getDecoration (SG::auxid_t auxid, size_t ndx) const |
Return reference to an aux decoration item. More... | |
const void * | getDataArray (SG::auxid_t auxid) const |
Return a const pointer to the start of an aux data vector. More... | |
void * | getDataArray (SG::auxid_t auxid) |
Return a pointer to the start of an aux data vector. More... | |
const void * | getDataArrayAllowMissing (SG::auxid_t auxid) const |
Return a const pointer to the start of an aux data vector. More... | |
void * | getDecorationArray (SG::auxid_t auxid) const |
Return a pointer to the start of an aux data vector for a decoration. More... | |
const AuxDataSpanBase * | getDataSpan (SG::auxid_t auxid) const |
Return a reference to a description of this vector's start+size. More... | |
static size_t s_minCacheLen | ATLAS_THREAD_SAFE |
Minimum length to use for the cache vector. More... | |
Other operations. | |
Cache m_cache | ATLAS_THREAD_SAFE |
Cached pointers to the start of aux data vectors, non-const. More... | |
Cache m_constCache | ATLAS_THREAD_SAFE |
Cached pointers to the start of aux data vectors, const. More... | |
Cache m_decorCache | ATLAS_THREAD_SAFE |
Cached pointers to the start of aux data vectors, decorations. More... | |
Cache m_spanCache | ATLAS_THREAD_SAFE |
Cached pointers to span descriptors. More... | |
SG::IAuxStore * | m_store |
Associated store, non-const. More... | |
const SG::IConstAuxStore * | m_constStore |
Associated store, const. More... | |
DataLink< SG::IConstAuxStore > | m_constStoreLink |
Associated store link, const. More... | |
mutex_t | m_mutex |
void | swap (AuxVectorData &other) |
Swap this instance with another. More... | |
void | clearCache () |
Clear the cached aux data pointers. More... | |
void | clearCache (SG::auxid_t auxid) |
Clear the cached aux data pointers for a single variable. More... | |
void | clearDecorCache (SG::auxid_t auxid) |
Clear the cached decoration pointer for a single variable. More... | |
virtual void | lock () override |
Lock the container. More... | |
bool | clearDecorations () const |
Clear all decorations. More... | |
void | lockDecoration (SG::auxid_t auxid) |
Explicitly lock a decoration. More... | |
const SG::IConstAuxStore * | getConstStoreOol () const |
Same as getConstStore. More... | |
void | setCache (SG::auxid_t auxid, void *ptr) |
Explicitly set a cache pointer. More... | |
void | setCache (SG::auxid_t auxid, const void *ptr) |
Explicitly set a cache pointer. More... | |
bool | isAvailableOol (auxid_t id) const |
Out-of-line portion of isAvailable. More... | |
bool | isAvailableWritableOol (auxid_t id) |
Out-of-line portion of isAvailableWritable. More... | |
bool | isAvailableWritableAsDecorationOol (auxid_t id) const |
Out-of-line portion of isAvailableWritableAsDecoration. More... | |
void * | getDataOol (SG::auxid_t auxid, bool allowMissing) |
Out-of-line portion of data access. More... | |
const void * | getDataOol (SG::auxid_t auxid, bool allowMissing) const |
Out-of-line portion of data access (const version). More... | |
void * | getDecorationOol (SG::auxid_t auxid) const |
Out-of-line portion of data access (decorator version). More... | |
const AuxDataSpanBase * | getDataSpanOol (SG::auxid_t auxid, bool allowMissing) const |
Return a reference to a description of this vector's start+size, out-of-line portion. More... | |
typedef AthContainers_detail::mutex | mutex_t |
Mutex used to synchronize modifications to the cache vector. More... | |
typedef AthContainers_detail::lock_guard< mutex_t > | guard_t |
static const SG::auxid_set_t | s_emptySet |
Empty auxid set, used for a return value when we have no associated store. More... | |
Manage index tracking and synchronization of auxiliary data.
An object, usually a DataVector
, can have vectors of auxiliary data associated with it. In order to be able to find the auxiliary data for a given container element, the elements must hold their indices within the container (done by the AuxElement
class).
When the container changes, this information must be updated. Indices need to be changed, and corresponding changes need to be made in the vectors of associated auxiliary data. Most of the code in this class consists of helpers that effect these changes. These are intended to be called only by the deriving container class.
This class also contains a flag to control whether or not indices should be tracked like this. This is controlled by the type of the payload and by the selected ownership and indexing policies.
If the payload type does not derive from SG::AuxElement
, then no index tracking is possible, and the flag is always false.
Otherwise, it depends on the setting of the policies. The default value for the index tracking policy is DEFAULT_TRACK_INDICES. In that case, we track indices if this container owns its elements (OWN_ELEMENTS) and we don't if the container does not down its elements (VIEW_ELEMENTS). This is the usual case. However, the index tracking policy may also be set to ALWAYS_TRACK_INDICES or NEVER_TRACK_INDICES to override this. (The major foreseen use case for this is to allow index tracking for a view container populated with objects allocated from a DataPool
.)
The derived container should initialize this class by calling initAuxVectorBase
. The derived container class is passed as a template argument; the ownership and index tracking policies are also passed. This method can be called again if the policies change.
There are only a couple user-callable methods. The trackIndices
method returns the current state of the index tracking flag. There are also wrappers for setStore
method, which enforce the condition that one can't set a store for a container that does not do index tracking.
The remaining methods are intended to be called only from the derived container class (and thus they are declared as protected). Besides a swap
method, these include
setIndices
, to reset the indices within a range to sequential values.clearIndex
, to clear the index / container for a single element.clearIndices
, to clear the index / container for elements within a range.resize
, to change the size of the aux data.reserve
, to change the capacity of the aux data.shift
, to shift a range of aux data up or down, to track insertions or deletions from within the container.moveAux
, to be used when an element or range of elements is moved into the container.swapElementsAux
, to swap aux data for two elements, possibly in different containers.resortAux
, to rearrange indices and aux data correctly after an operation that permuted the elements of the container. Definition at line 96 of file AuxVectorBase.h.
using SG::AuxVectorBase::const_span = typename AuxDataTraits<T>::const_span |
Definition at line 102 of file AuxVectorBase.h.
|
privateinherited |
Definition at line 989 of file AuxVectorData.h.
|
privateinherited |
Mutex used to synchronize modifications to the cache vector.
Definition at line 988 of file AuxVectorData.h.
using SG::AuxVectorBase::span = typename AuxDataTraits<T>::span |
Spans over auxiliary variables.
Definition at line 101 of file AuxVectorBase.h.
SG::AuxVectorBase::AuxVectorBase | ( | ) |
Default constructor.
This will disable index tracking by default. The constructor should be followed by a call to initAuxVectorBase
. (This is separated from the constructor because calling non-default constructors of DataVector
base classes can be awkward in the case of virtual derivation.)
Definition at line 29 of file AuxVectorBase.cxx.
SG::AuxVectorBase::AuxVectorBase | ( | AuxVectorBase && | rhs | ) |
Move constructor.
rhs | The container from which to move. |
Definition at line 39 of file AuxVectorBase.cxx.
|
virtual |
|
pure virtualinherited |
Return the capacity of the container.
This is used when we need to create a new aux data vector.
Implemented in SG::AuxVectorInterface, DataVector< T, DataModel_detail::NoBase >, and SG::AuxElementData.
|
inherited |
Clear the cached aux data pointers.
You should call this any time something changes in the aux store that could invalidate the vector pointers.
|
inherited |
Clear the cached aux data pointers for a single variable.
auxid | ID of the variable to clear. |
Not really safe to use if another thread may be accessing the same decoration.
|
inherited |
Clear all decorations.
Erase all decorations from the store, restoring the state to when lock
was called.
Returns true if there were any decorations that were cleared, false if the store did not contain any decorations.
Definition at line 653 of file AuxVectorData.cxx.
|
inherited |
Clear the cached decoration pointer for a single variable.
auxid | ID of the variable to clear. |
Not really safe to use if another thread may be accessing the same decoration.
|
protected |
Clear the container / index for element elt
.
elt | Iterator to the element to clear. |
ForwardIterator
should be an iterator over the DataVector
(not a base iterator).
|
private |
Clear the container / index for element elt
.
elt | Iterator to the element to clear. |
This is the no-auxdata case; doesn't do anything other than checking m_trackIndices
.
|
private |
Clear the container / index for element elt
.
elt | Iterator to the element to clear. |
This is the auxdata case.
|
protected |
Clear the container / index for a range of elements.
beg | Beginning of the range. |
end | End of the range. |
ForwardIterator
should be an iterator over the DataVector
(not a base iterator).
|
private |
Clear the container / index for a range of elements.
beg | Beginning of the range. |
end | End of the range. |
No-auxdata case; a no-op except for checking m_trackIndices
.
|
private |
Clear the container / index for a range of elements.
beg | Beginning of the range. |
end | End of the range. |
Auxdata case.
|
inherited |
Return a set of identifiers for existing data items in store associated with this object.
This will include identifiers for all items, const and non-const. If no store is associated with this object, this will return an empty set.
Definition at line 203 of file AuxVectorData.cxx.
const_span<T> SG::AuxVectorBase::getConstDataSpan | ( | const std::string & | name | ) | const |
Return a span over an aux data item.
auxid | The desired aux data item. |
This will return a span containing the value of the requested auxiliary variable for all elements in the container. If the item doesn't exist, it will be created. Errors are signaled by raising an exception. Note that the value_type
of the span is not necessarily T
; an example is bool
for which we return a span of char
.
|
inherited |
Return the current store, as a const interface.
This will be non-zero if either a const or non-const store is associated with this object.
|
inherited |
Return the data link to the current store, as a const interface.
This is set by persistency when reading an object, but it may be overridden by setting the store pointer directly.
|
inherited |
Same as getConstStore.
But out-of-line, as sometimes the debugger has problems calling inline functions.
Definition at line 704 of file AuxVectorData.cxx.
|
inherited |
Return reference to an aux data item.
auxid | The desired aux data item. |
ndx | Index of the element to return. |
This will return a reference to element ndx
of aux data item auxid
. If the aux data item does not exist, it will be created. Errors are signaled by raising an exception.
Warning: no type checking is done. You should usually access the data via Accessor
or ConstAccessor
.
|
inherited |
Return const reference to an aux data item.
auxid | The desired aux data item. |
ndx | Index of the element to return. |
This will return a reference to element ndx
of aux data item auxid
. Errors are signaled by raising an exception.
Warning: no type checking is done. You should usually access the data via Accessor
or ConstAccessor
.
|
inherited |
Return a pointer to the start of an aux data vector.
auxid | The desired aux data item. |
This will return a pointer to the start of the data for aux data item auxid
. If the item doesn't exist, it will be created. Errors are signaled by raising an exception.
|
inherited |
Return a const pointer to the start of an aux data vector.
auxid | The desired aux data item. |
This will return a pointer to the start of the data for aux data item auxid
. Errors are signaled by raising an exception.
|
inherited |
Return a const pointer to the start of an aux data vector.
auxid | The desired aux data item. |
This will return a pointer to the start of the data for aux data item auxid
. If the item does not exist, this will return nullptr rather than raising an exception.
|
private |
|
privateinherited |
Out-of-line portion of data access.
auxid | aux data item being accessed. |
allowMissing | If true, then return nullptr if the variable is missing rather than throwing an exception. |
When this function returns, the cache entry m_cache
[auxid] will be valid. That entry is also returned. If there's an error, the function will throw an exception rather than returning.
Definition at line 308 of file AuxVectorData.cxx.
|
privateinherited |
Out-of-line portion of data access (const version).
auxid | aux data item being accessed. |
allowMissing | If true, then return nullptr if the variable is missing rather than throwing an exception. |
When this function returns, the cache entry m_constCache
[auxid] will be valid. That entry is also returned. If there's an error, the function will throw an exception rather than returning.
Definition at line 353 of file AuxVectorData.cxx.
Return a span over an aux data item.
auxid | The desired aux data item. |
This will return a span containing the value of the requested auxiliary variable for all elements in the container. If the item doesn't exist, it will be created. Errors are signaled by raising an exception. Note that the value_type
of the span is not necessarily T
; an example is bool
for which we return a span of char
.
const_span<T> SG::AuxVectorBase::getDataSpan | ( | const std::string & | name | ) | const |
Return a span over an aux data item.
auxid | The desired aux data item. |
This will return a span containing the value of the requested auxiliary variable for all elements in the container. If the item doesn't exist, it will be created. Errors are signaled by raising an exception. Note that the value_type
of the span is not necessarily T
; an example is bool
for which we return a span of char
.
|
inherited |
Return a reference to a description of this vector's start+size.
auxid | The desired aux data item. |
This low-overhead method of getting the start+size of an auxiliary variable. The returned object will be updated if the variable's vector changes. Raises an exception if the variable does not exist.
This is in principle a const-correctness violation, since AuxDataSpanBase
has a non-const pointer to the start of the vector. But doing it properly is kind of painful, and as this interface is only meant to be used internally, it's likely not a real problem.
|
privateinherited |
Return a reference to a description of this vector's start+size, out-of-line portion.
auxid | The desired aux data item. |
allowMissing | If true, then return nullptr if the variable is missing rather than throwing an exception. |
When this function returns, the cache entry m_spanCache
[auxid] will be valid. That entry is also returned. If there's an error, the function will throw an exception rather than returning.
Definition at line 456 of file AuxVectorData.cxx.
|
inherited |
Return reference to an aux decoration item.
auxid | The desired aux decoration item. |
ndx | Index of the element to return. |
This will return a reference to element ndx
of aux decoration item auxid
. If the aux data item does not exist, it will be created. Errors are signaled by raising an exception.
Warning: no type checking is done. You should usually access the data via Decorator
.
The difference between getDecoration
and getData
is that getDecoration
takes a const container as input, but returns a non-const reference. This will only succeed if either the container is not locked or the item was first accessed as a decoration.
|
inherited |
Return a pointer to the start of an aux data vector for a decoration.
auxid | The desired aux data item. |
This will return a pointer to the start of the data for aux data item auxid
. If the item doesn't exist, it will be created. Errors are signaled by raising an exception.
The difference between getDecorationArray
and getDataArray
is that getDecorationArray
takes a const container as input, but returns a non-const pointer. This will only succeed if either the container is not locked or the item was first accessed as a decoration.
|
privateinherited |
Out-of-line portion of data access (decorator version).
auxid | aux data item being accessed. |
When this function returns, the cache entry m_cache
[auxid] will be valid. That entry is also returned. If there's an error, the function will throw an exception rather than returning.
The difference between getDecorationOol
and getDataOol
is that getDecorationOol
takes a const container as input, but returns a non-const pointer. This will only succeed if either the container is not locked or the item was first accessed as a decoration.
Definition at line 397 of file AuxVectorData.cxx.
Return a span over an aux data item for a decoration.
auxid | The desired aux data item. |
This will return a span containing the value of the requested auxiliary variable for all elements in the container. If the item doesn't exist, it will be created. Errors are signaled by raising an exception. Note that the value_type
of the span is not necessarily T
; an example is bool
for which we return a span of char
.
The difference between getDecorationSpan
and getDataSpan
is that getDecorationSpan
takes a const container as input, but returns a span over non-const objects. This will only succeed if either the container is not locked or the item was first accessed as a decoration.
|
inherited |
Return a set of identifiers for decorations for this object.
Definition at line 215 of file AuxVectorData.cxx.
|
inherited |
Return the current store, as a non-const interface.
This will be non-zero if a non-const store is associated with this object.
|
inherited |
Return the current store, as a non-const interface.
This will be non-zero if a non-const store is associated with this object.
|
inherited |
Return a set of identifiers for writable data items in this store.
This will include only non-const identifiers. If no store is associated with this object, this will return an empty set.
Definition at line 231 of file AuxVectorData.cxx.
|
inherited |
Return true if this object has an associated non-const store.
|
inherited |
Return true if this object has an associated store.
|
protected |
Initialize index tracking mode.
ownPolicy | The container ownership policy. |
indexTrackingPolicy | The requested index tracking policy. |
DVL should be the most-derived class for this container.
This handles the logic for setting the state of index tracking. If this container does not handle aux data, then index tracking is always off. Otherwise, it depends on the requested policies. In any case, it is an error to turn off index tracking for a container that has an associated aux store.
|
private |
Initialize index tracking mode — no-auxdata specialization.
ownPolicy | The container ownership policy. |
indexTrackingPolicy | The requested index tracking policy. |
Since this is the no-auxdata case, it always sets index tracking to false. An exception is raised if the container has an associated store (but that should never actually happen).
Definition at line 132 of file AuxVectorBase.cxx.
|
private |
Initialize index tracking mode — auxdata specialization.
ownPolicy | The container ownership policy. |
indexTrackingPolicy | The requested index tracking policy. |
Sets index tracking based on the requested policies. An exception is raised if index tracking is disabled and the container has an associated store.
Definition at line 152 of file AuxVectorBase.cxx.
bool SG::AuxVectorData::isAvailable |
Test to see if a variable exists in the store.
id | The variable to test. |
|
inherited |
Test to see if a variable exists in the store.
id | The variable to test. |
bool SG::AuxVectorBase::isAvailable | ( | const std::string & | name, |
const std::string & | clsname = "" |
||
) | const |
Test to see if a variable exists in the store.
name | Name of the aux variable. |
clsname | The name of the associated class. May be blank. |
|
privateinherited |
Out-of-line portion of isAvailable.
id | The variable to test. |
Definition at line 243 of file AuxVectorData.cxx.
bool SG::AuxVectorData::isAvailableWritable |
Test to see if a variable is available for writing.
id | The variable to test. |
|
inherited |
Test to see if a variable is available for writing.
id | The variable to test. |
bool SG::AuxVectorBase::isAvailableWritable | ( | const std::string & | name, |
const std::string & | clsname = "" |
||
) |
Test to see if a variable is available for writing.
name | Name of the aux variable. |
clsname | The name of the associated class. May be blank. |
bool SG::AuxVectorData::isAvailableWritableAsDecoration |
Test to see if a variable is available for writing as a decoration.
id | The variable to test. |
|
inherited |
Test to see if a variable is available for writing as a decoration.
id | The variable to test. |
bool SG::AuxVectorBase::isAvailableWritableAsDecoration | ( | const std::string & | name, |
const std::string & | clsname = "" |
||
) | const |
Test to see if a variable is available for writing as a decoration.
name | Name of the aux variable. |
clsname | The name of the associated class. May be blank. |
|
privateinherited |
Out-of-line portion of isAvailableWritableAsDecoration.
id | The variable to test. |
Definition at line 282 of file AuxVectorData.cxx.
|
privateinherited |
Out-of-line portion of isAvailableWritable.
id | The variable to test. |
Definition at line 270 of file AuxVectorData.cxx.
|
overridevirtualinherited |
Lock the container.
After this, only decorations can be changed/modified. If the container is already locked, this is a no-op.
Implements ILockable.
Definition at line 633 of file AuxVectorData.cxx.
|
inherited |
Explicitly lock a decoration.
auxid | ID of the decoration to lock. |
This is only safe if no other thread can be accessing this decoration. It is strongly preferred to do this via a WriteDecorHandle
, where the dependencies can help ensure this.
Definition at line 687 of file AuxVectorData.cxx.
|
protected |
Set index on an element and copy auxiliary data.
index | Container index at which the new element is being added. |
p | The new element being added. |
clear | If true, then any auxiliary data initially associated with p are cleared after being copied. |
skipDestClear | Normally, if p does not have auxiliary data, then the variables of the destination are cleared. If this flag is true, then this clear is skipped. This can be appropriate as part of a push_back, where the destination is already known to be clear. |
Overload for the no-auxdata case.
|
protected |
Set index on a range of elements and copy auxiliary data.
index | Container index at which the first new element is being added. |
beg | The start of the range of new elements. |
end | The end of the range of new elements. |
clear | If true, then any auxiliary data initially associated with the elements are cleared after being copied. |
skipDestClear | Normally, if the elements do not have auxiliary data, then the variables of the destination are cleared. If this flag is true, then this clear is skipped. This can be appropriate as part of a push_back, where the destination is already known to be clear. |
The elements in the range are being a added to the container at index
. If the new elements have associated auxiliary data, copy it to the container starting at index
. Then set the container / index on the elements in the range.
ForwardIterator
should be an iterator over the DataVector
(not a base iterator).
|
protected |
Set index on an element and copy auxiliary data.
index | Container index at which the new element is being added. |
p | The new element being added. |
clear | If true, then any auxiliary data initially associated with p are cleared after being copied. |
skipDestClear | Normally, if p does not have auxiliary data, then the variables of the destination are cleared. If this flag is true, then this clear is skipped. This can be appropriate as part of a push_back, where the destination is already known to be clear. |
Element p
is being added to the container at index
. If p
has associated auxiliary data, copy it to the container at index
. Then set the container / index on p
.
Definition at line 223 of file AuxVectorBase.cxx.
|
private |
Set index on a range of elements and copy auxiliary data.
index | Container index at which the first new element is being added. |
beg | The start of the range of new elements. |
end | The end of the range of new elements. |
clear | If true, then any auxiliary data initially associated with the elements are cleared after being copied. |
skipDestClear | Normally, if the elements do not have auxiliary data, then the variables of the destination are cleared. If this flag is true, then this clear is skipped. This can be appropriate as part of a push_back, where the destination is already known to be clear. |
No-auxdata version; a no-op except for checking m_trackIndices
.
|
private |
Set index on a range of elements and copy auxiliary data.
index | Container index at which the first new element is being added. |
beg | The start of the range of new elements. |
end | The end of the range of new elements. |
clear | If true, then any auxiliary data initially associated with the elements are cleared after being copied. |
skipDestClear | Normally, if the elements do not have auxiliary data, then the variables of the destination are cleared. If this flag is true, then this clear is skipped. This can be appropriate as part of a push_back, where the destination is already known to be clear. |
The elements in the range are being a added to the container at index
. If the new elements have associated auxiliary data, copy it to the container starting at index
. Then set the container / index on the elements in the range.
The auxdata case.
AuxVectorBase & SG::AuxVectorBase::operator= | ( | AuxVectorBase && | rhs | ) |
Move assignment.
rhs | The container from which to move. |
Definition at line 50 of file AuxVectorBase.cxx.
|
protected |
Change the capacity of the aux data associated with this container.
size | The new container size. |
DVL should be the most-derived class for this container.
|
private |
Change the capacity of the aux data associated with this container.
size | The new container size. |
The no-auxdata case; a no-op except for checking m_trackIndices
.
|
private |
Change the capacity of the aux data associated with this container.
size | The new container size. |
The auxdata case.
Definition at line 195 of file AuxVectorBase.cxx.
|
protected |
Resize the aux data associated with this container.
size | The new container size. |
DVL should be the most-derived class for this container.
|
private |
Resize the aux data associated with this container.
size | The new container size. |
The no-auxdata case; a no-op except for checking m_trackIndices
.
|
private |
Resize the aux data associated with this container.
size | The new container size. |
The auxdata case.
Definition at line 176 of file AuxVectorBase.cxx.
|
protected |
Reset indices / reorder aux data after elements have been permuted.
index | Index in the container of the start of the range. |
beg | Start of the range of elements to process. |
end | End of the range of elements to process. |
Call this after some operation that has permuted the elements in the container (such as sort). The index information in the elements will be used to permute all auxiliary data in the same way. Finally, all the indices will be reset in the correct order.
ForwardIterator
should be an iterator over the DataVector
(not a base iterator).
|
private |
Reset indices / reorder aux data after elements have been permuted.
index | Index in the container of the start of the range. |
beg | Start of the range of elements to process. |
end | End of the range of elements to process. |
No-auxdata version; a no-op except for checking m_trackIndices
.
|
private |
Reset indices / reorder aux data after elements have been permuted.
index | Index in the container of the start of the range. |
beg | Start of the range of elements to process. |
end | End of the range of elements to process. |
Call this after some operation that has permuted the elements in the container (such as sort). The index information in the elements will be used to permute all auxiliary data in the same way. Finally, all the indices will be reset in the correct order.
The auxdata case.
|
protectedinherited |
Explicitly set a cache pointer.
auxid | Variable ID to set. |
ptr | Pointer to which the cache entry should be set. |
For internal use; do not use from user code. This does not acquire the lock — it's mostly meant to be used from a constructor.
|
protectedinherited |
Explicitly set a cache pointer.
auxid | Variable ID to set. |
ptr | Pointer to which the cache entry should be set. |
For internal use; do not use from user code. This does not acquire the lock — it's mostly meant to be used from a constructor.
void SG::AuxVectorBase::setConstStore | ( | const SG::IConstAuxStore * | store | ) |
Synonym for setStore
with IConstAuxStore
.
store | The new store. |
|
private |
|
protected |
Set container/index for all elements within a range.
beg | Beginning of the range. |
end | End of the range. |
first | Index to set for the first element in the range. |
For all elements in the range, the container will be set to this container, and indices will be set sequentially, starting with first
.
ForwardIterator
should be an iterator over the DataVector
(not a base iterator).
|
private |
Set container/index for all elements within a range.
beg | Beginning of the range. |
end | End of the range. |
first | Index to set for the first element in the range. |
This is the no-auxdata case; doesn't do anything other than checking m_trackIndices
.
|
private |
Set container/index for all elements within a range.
beg | Beginning of the range. |
end | End of the range. |
first | Index to set for the first element in the range. |
This is the auxdata case. For all elements in the range, the container will be set to this container, and indices will be set sequentially, starting with first
.
void SG::AuxVectorBase::setNonConstStore | ( | SG::IAuxStore * | store | ) |
Synonym for setStore
with IAuxStore
.
store | The new store. |
|
inherited |
Set an option for an auxiliary data variable.
id | The variable for which we want to set the option. |
option | The option setting to make. |
The interpretation of option
depends on the associated auxiliary store. See PackedParameters.h for option settings for writing packed data. Returns true
on success, false
otherwise.
Definition at line 150 of file AuxVectorData.cxx.
|
inherited |
Set an option for an auxiliary data variable.
id | The variable for which we want to set the option. |
optname | The name of the option to set. |
arg | The option value to set. |
The interpretation of option
depends on the associated auxiliary store. See PackedParameters.h for option settings for writing packed data. Returns true
on success, false
otherwise.
|
inherited |
Set an option for an auxiliary data variable.
name | The name of the variable. |
option | The option setting to make. |
The interpretation of option
depends on the associated auxiliary store. See PackedParameters.h for option settings for writing packed data. Returns true
on success, false
otherwise.
Definition at line 168 of file AuxVectorData.cxx.
|
inherited |
Set an option for an auxiliary data variable.
name | The name of the variable. |
clsname | The name of the associated class. May be blank. |
option | The option setting to make. |
The interpretation of option
depends on the associated auxiliary store. See PackedParameters.h for option settings for writing packed data. Returns true
on success, false
otherwise.
Definition at line 186 of file AuxVectorData.cxx.
|
inherited |
Set an option for an auxiliary data variable.
name | The name of the variable. |
clsname | The name of the associated class. May be blank. |
optname | The name of the option to set. |
arg | The option value to set. |
The interpretation of option
depends on the associated auxiliary store. See PackedParameters.h for option settings for writing packed data. Returns true
on success, false
otherwise.
|
inherited |
|
inherited |
|
inherited |
Set an option for an auxiliary data variable.
name | The name of the variable. |
optname | The name of the option to set. |
arg | The option value to set. |
The interpretation of option
depends on the associated auxiliary store. See PackedParameters.h for option settings for writing packed data. Returns true
on success, false
otherwise.
void SG::AuxVectorBase::setStore | ( | const DataLink< SG::IConstAuxStore > & | store | ) |
Set the store associated with this object.
store | The new store. |
This will clear the non-const store pointer, and also clear the cache.
It is an error to set a store for a container for which index tracking is disabled. That will raise an ExcUntrackedSetStore
exception.
Definition at line 114 of file AuxVectorBase.cxx.
void SG::AuxVectorBase::setStore | ( | const SG::IConstAuxStore * | store | ) |
Set the store associated with this object.
store | The new store. |
This will clear the non-const store pointer, and also clear the cache.
It is an error to set a store for a container for which index tracking is disabled. That will raise an ExcUntrackedSetStore
exception.
Definition at line 78 of file AuxVectorBase.cxx.
void SG::AuxVectorBase::setStore | ( | SG::IAuxStore * | store | ) |
Set the store associated with this object.
store | The new store. |
This will set both the const and non-const store pointers, and also clear the cache.
It is an error to set a store for a container for which index tracking is disabled. That will raise an ExcUntrackedSetStore
exception.
nb. List the non-const overload before the const one; otherwise, we can't call the const one from python.
store | The new store. |
This will set both the const and non-const store pointers, and also clear the cache.
It is an error to set a store for a container for which index tracking is disabled. That will raise an ExcUntrackedSetStore
exception.
Definition at line 96 of file AuxVectorBase.cxx.
|
protected |
Shift the elements of the container.
cont | The container that's being shifted. |
pos | The starting index for the shift. |
offs | The (signed) amount of the shift. |
The container should be the derived container. The elements in the container should have already been shifted; this operation will then adjust the element indices and also shift the elements in the vectors for all aux data items. offs
may be either positive or negative.
If offs
is positive, then the container is growing. The container size should be increased by offs
, the element at pos
moved to pos
+ offs
, and similarly for following elements. The elements between pos
and pos
+ offs
should be default-initialized.
If offs
is negative, then the container is shrinking. The element at pos
should be moved to pos
+ offs
, and similarly for following elements. The container should then be shrunk by -offs
elements (running destructors as appropriate).
|
private |
Shift the elements of the container.
cont | The container that's being shifted. |
pos | The starting index for the shift. |
offs | The (signed) amount of the shift. |
No-auxdata version; a no-op except for checking m_trackIndices
.
|
private |
Shift the elements of the container.
cont | The container that's being shifted. |
pos | The starting index for the shift. |
offs | The (signed) amount of the shift. |
Auxdata version.
The container should be the derived container. The elements in the container should have already been shifted; this operation will then adjust the element indices and also shift the elements in the vectors for all aux data items. offs
may be either positive or negative.
If offs
is positive, then the container is growing. The container size should be increased by offs
, the element at pos
moved to pos
+ offs
, and similarly for following elements. The elements between pos
and pos
+ offs
should be default-initialized.
If offs
is negative, then the container is shrinking. The element at pos
should be moved to pos
+ offs
, and similarly for following elements. The container should then be shrunk by -offs
elements (running destructors as appropriate).
|
pure virtualinherited |
Return the size of the container.
This is used when we need to create a new aux data vector.
Implemented in SG::AuxVectorInterface, DataVector< T, DataModel_detail::NoBase >, and SG::AuxElementData.
|
protected |
Swap with another container.
other | The container with which to swap. |
|
inherited |
Swap this instance with another.
other | The other instance with which to swap. |
|
protected |
Swap indices and auxiliary data between two elements.
aindex | Index of the first element, in this container. |
bindex | Index of the second element, in bcont . |
a | Pointer to the first element. |
b | Pointer to the second element. |
bcont | Container holding the second element. (May be the same as this, but doesn't have to be.) |
This is the no-auxdata case; it is a no-op except for checking m_trackIndices
.
|
protected |
Swap indices and auxiliary data between two elements.
aindex | Index of the first element, in this container. |
bindex | Index of the second element, in bcont . |
a | Pointer to the first element. |
b | Pointer to the second element. |
bcont | Container holding the second element. (May be the same as this, but doesn't have to be.) |
Elements a
at aindex
in this
and b
at bindex
in bcont
are being swapped. Swap the index / container references between the elements and also swap the auxiliary data if it exists.
Definition at line 257 of file AuxVectorBase.cxx.
bool SG::AuxVectorBase::trackIndices | ( | ) | const |
Return true if index tracking is enabled for this container.
|
friend |
Definition at line 862 of file AuxVectorBase.h.
|
staticprotectedinherited |
Minimum length to use for the cache vector.
Only changed by unit tests.
Definition at line 593 of file AuxVectorData.h.
|
mutableprivateinherited |
Cached pointers to the start of aux data vectors, non-const.
Definition at line 963 of file AuxVectorData.h.
|
mutableprivateinherited |
Cached pointers to the start of aux data vectors, const.
Definition at line 966 of file AuxVectorData.h.
|
mutableprivateinherited |
Cached pointers to the start of aux data vectors, decorations.
Definition at line 969 of file AuxVectorData.h.
|
mutableprivateinherited |
Cached pointers to span descriptors.
Definition at line 972 of file AuxVectorData.h.
|
privateinherited |
Associated store, const.
Definition at line 980 of file AuxVectorData.h.
|
privateinherited |
Associated store link, const.
Definition at line 984 of file AuxVectorData.h.
|
mutableprivateinherited |
Definition at line 990 of file AuxVectorData.h.
|
privateinherited |
Associated store, non-const.
Definition at line 976 of file AuxVectorData.h.
|
private |
Flag if index tracking is enabled.
Definition at line 866 of file AuxVectorBase.h.
|
staticprivateinherited |
Empty auxid set, used for a return value when we have no associated store.
Definition at line 993 of file AuxVectorData.h.
|
staticconstexpr |
Mark that this type supports thinning operations.
See AthContainers/supportsThinning.h and AthenaPoolCnvSvc/T_AthenaPoolCnv.h. Helps guide which pool converter template will be used. If false, the default pool converter will be used rather than the aux store-specific one. Ordinary xAOD type should not touch this, but may be overridden in a derived class to handle certain special cases.
Definition at line 315 of file AuxVectorBase.h.