![]() |
ATLAS Offline Software
|
Extended Helper class to associate ranges of elements in multiple containers to a contiguous index to be used in a MT context The base class is extended by a container list which can be grown dynamically (mutex protected), and the per module element range is atomic. More...
#include <PhaseIIInDetRawDataContainerMT.h>
Public Types | |
| typedef std::true_type | thread_safe |
| using | BASE = PhaseII::IndexedRanges<T_RawDataContainer, std::atomic<PhaseII::DataRange> > |
| using | ContainerPtr = typename DynamicContainerListHelper<T_RawDataContainer>::ContainerPtr |
| using | DataContainerType |
| using | T_RangeTypeBase |
Public Member Functions | |
| IndexedRangesMT (unsigned int n_ranges, unsigned int n_slots) | |
| ContainerPtr | getNewContainerPtr () |
| get an unused container to add new RDOs. | |
| unsigned int | getNewContainerIndex () |
| Add a new container to the list of containers and return its index. | |
| bool | registerOrEraseNewData (unsigned int index, const T_RangeTypeBase &new_range) |
| register an element range or erase the elements of this range. | |
| bool | update (unsigned int index, T_RangeTypeBase &is_range, const T_RangeTypeBase &new_range) |
| update a range (version for an "atomic" range) | |
| bool | update (unsigned int index, T_RangeTypeBase &is_range, const T_RangeTypeBase &new_range) |
| update a range (version for a "non-atomic" range) | |
| const T_RawDataContainer & | data (unsigned int container_index) const |
| Get an existing container from the container collection (read only). | |
| T_RawDataContainer & | data (unsigned int container_index) |
| Get an existing container from the container collection. | |
| const std::atomic< PhaseII::DataRange > & | range (unsigned int index) const |
| Get a specific element range. | |
| std::size_t | size () const |
| return the total number of element ranges. | |
| std::size_t | empty () const |
| return true there are no element ranges. | |
| std::size_t | containerListCapacity () const |
| const auto & | errorContainer (unsigned int container_index) const |
| if there is an associated error container get it. | |
| auto & | errorContainer (unsigned int container_index) |
| if there is an associated error container get it (read/write access). | |
Protected Attributes | |
| ContainerList< T_RawDataContainer > | m_containers |
| std::vector< std::atomic< PhaseII::DataRange > > | m_range |
Private Attributes | |
| DynamicContainerListHelper< T_RawDataContainer > | m_containerListHelper |
Extended Helper class to associate ranges of elements in multiple containers to a contiguous index to be used in a MT context The base class is extended by a container list which can be grown dynamically (mutex protected), and the per module element range is atomic.
If the initial guess for the container list is conservative enough, then the only additional overhead are atomic operations when registering an element range per module, the atomic operation to the increment the container used counter. If the initial guess was too optimistic, the container list needs to be grown which is mutex protected, but will be done in chunks.
Definition at line 20 of file PhaseIIInDetRawDataContainerMT.h.
| using PhaseII::IndexedRangesMT< T_RawDataContainer >::BASE = PhaseII::IndexedRanges<T_RawDataContainer, std::atomic<PhaseII::DataRange> > |
Definition at line 24 of file PhaseIIInDetRawDataContainerMT.h.
| using PhaseII::IndexedRangesMT< T_RawDataContainer >::ContainerPtr = typename DynamicContainerListHelper<T_RawDataContainer>::ContainerPtr |
Definition at line 26 of file PhaseIIInDetRawDataContainerMT.h.
|
inherited |
Definition at line 82 of file PhaseIIInDetRawDataContainer.h.
|
inherited |
Definition at line 83 of file PhaseIIInDetRawDataContainer.h.
| typedef std::true_type PhaseII::IndexedRangesMT< T_RawDataContainer >::thread_safe |
Definition at line 23 of file PhaseIIInDetRawDataContainerMT.h.
|
inline |
Definition at line 27 of file PhaseIIInDetRawDataContainerMT.h.
|
inlineinherited |
Definition at line 154 of file PhaseIIInDetRawDataContainer.h.
|
inlineinherited |
Get an existing container from the container collection.
| container_index | the index which identifies the container in the container collection. |
Definition at line 136 of file PhaseIIInDetRawDataContainer.h.
|
inlineinherited |
Get an existing container from the container collection (read only).
| container_index | the index which identifies the container in the container collection. |
Definition at line 131 of file PhaseIIInDetRawDataContainer.h.
|
inlineinherited |
return true there are no element ranges.
Definition at line 151 of file PhaseIIInDetRawDataContainer.h.
|
inlineinherited |
if there is an associated error container get it (read/write access).
Definition at line 163 of file PhaseIIInDetRawDataContainer.h.
|
inlineinherited |
if there is an associated error container get it.
Definition at line 157 of file PhaseIIInDetRawDataContainer.h.
|
inline |
Add a new container to the list of containers and return its index.
if the container list capacity is not exhausted a new container list will be created with a larger capacity and the contents of the current list will be copied to it. All future requests will use that new list, but the old list is kept arround since there may still be users, and there is no reference counting.
Definition at line 43 of file PhaseIIInDetRawDataContainerMT.h.
|
inline |
get an unused container to add new RDOs.
Definition at line 34 of file PhaseIIInDetRawDataContainerMT.h.
|
inlineinherited |
Get a specific element range.
| index | the index which identifies the element range the element range will in addition to the actual element range also provide the index of the container in container collection which contains these elements. |
Definition at line 143 of file PhaseIIInDetRawDataContainer.h.
|
inlineinherited |
register an element range or erase the elements of this range.
| index | and index which identifies the range i.e. the group of elements of this range |
| new_range | the element range that should be be registered. The element range will be registered for the given index unless a range has been registered already. In the latter case the element of this new range well be erased. |
Definition at line 97 of file PhaseIIInDetRawDataContainer.h.
|
inlineinherited |
return the total number of element ranges.
Definition at line 149 of file PhaseIIInDetRawDataContainer.h.
|
inlineinherited |
|
inlineinherited |
|
private |
Definition at line 50 of file PhaseIIInDetRawDataContainerMT.h.
|
protectedinherited |
Definition at line 169 of file PhaseIIInDetRawDataContainer.h.
|
protectedinherited |
Definition at line 170 of file PhaseIIInDetRawDataContainer.h.