![]() |
ATLAS Offline Software
|
Helper class which provides a possibly dynamically growing list of containers suitable for a multi-threaded context. More...
#include <ContainerList.h>
Public Member Functions | |
| ContainerList (unsigned int expected_max_container) | |
| Create a container list for a certain number of containers. | |
| std::size_t | size () const |
| The number of containers in this list. | |
| T_Container & | operator[] (unsigned int idx) |
| Return the container with the given container index (read-write).a. | |
| const T_Container & | operator[] (unsigned int idx) const |
| Return the container with the given container index (read-only). | |
Private Types | |
| using | T_ContainerPtr = T_Container * |
| using | ContainerPtrList = T_ContainerPtr * |
Static Private Member Functions | |
| static std::span< T_ContainerPtr > | fillContainerList (unsigned int begin_idx, std::vector< T_Container > &container, std::span< T_ContainerPtr > container_list) |
| Write pointers to containers in the given vector to a list starting at begin_index. | |
Private Attributes | |
| T_Container * | m_singleElementContainerList {} |
| A container "list" which can only contain a single container. | |
| std::span< T_ContainerPtr > | m_containerList |
| The current container list. | |
| std::vector< std::vector< T_Container > > | m_container |
| All containers. | |
| std::vector< std::vector< T_ContainerPtr > > | m_containerListHistory |
| The history of the container lists where each subsequent element is an extended copy of the preceding list. | |
Friends | |
| struct | DynamicContainerListHelper< T_Container > |
Helper class which provides a possibly dynamically growing list of containers suitable for a multi-threaded context.
The idea is that there is a reasonable estimate of the total number of needed containers, however if the estimate was too optimistic the list can be grown. The operation to grow the list is mutex protected.
Definition at line 21 of file ContainerList.h.
|
private |
Definition at line 25 of file ContainerList.h.
|
private |
Definition at line 24 of file ContainerList.h.
|
inline |
Create a container list for a certain number of containers.
| expected_max_container | the number of expected containers this list will have (in most cases this should rather be too large than too small). If the initial guess was too optimistic the list will be grown, which adds some computational overhead (lock congestion). |
Definition at line 33 of file ContainerList.h.
|
inlinestaticprivate |
Write pointers to containers in the given vector to a list starting at begin_index.
| begin_index | the pointer of the first element in container will be written to to container_list[begin_index] and so forth. |
| container | a vector of new containers which are to be registered in the given container list |
| container_list | a contiguous list of all the containers. |
Definition at line 62 of file ContainerList.h.
|
inline |
Return the container with the given container index (read-write).a.
Definition at line 47 of file ContainerList.h.
|
inline |
Return the container with the given container index (read-only).
Definition at line 52 of file ContainerList.h.
|
inline |
|
friend |
Definition at line 1 of file ContainerList.h.
|
private |
All containers.
Definition at line 80 of file ContainerList.h.
|
private |
The current container list.
Definition at line 77 of file ContainerList.h.
|
private |
The history of the container lists where each subsequent element is an extended copy of the preceding list.
Definition at line 83 of file ContainerList.h.
|
private |
A container "list" which can only contain a single container.
Definition at line 75 of file ContainerList.h.