![]() |
ATLAS Offline Software
|
#include <ContainerAccessor.h>
Public Types | |
| using | container_t = DataVector< value_t > |
| using | Iterator = typename container_t::const_iterator |
| using | Range = std::pair< Iterator, Iterator > |
Public Member Functions | |
| ContainerAccessor (const container_t &values, std::function< identifier_t(const value_t &)> mapper, size_t max_ids=2000) | |
| Constructor. More... | |
| ~ContainerAccessor ()=default | |
| Default destructor. More... | |
| ContainerAccessor (const ContainerAccessor &)=delete | |
| Copy constructor, deleted. More... | |
| ContainerAccessor & | operator= (const ContainerAccessor &)=delete |
| const boost::container::small_vector< Range, inline_size > | rangesForIdentifierDirect (const identifier_t &identifier) const |
| Function to return the list of ranges corresponding to a given identifier. More... | |
| bool | isIdentifierPresent (const identifier_t &identifier) const |
| Function to verify if a given identifier is present in the map, i.e. More... | |
| std::vector< identifier_t > | allIdentifiers () const |
| Function to return all available identifier (i.e. keys in the map) More... | |
Private Attributes | |
| std::unordered_map< identifier_t, boost::container::small_vector< Range, inline_size > > | m_ranges |
Class implementing how to access a container
It is templated on the type of the objects in the container (value_t), and the type of the identifier (identifier_t)
Definition at line 25 of file ContainerAccessor.h.
| using ContainerAccessor< value_t, identifier_t, inline_size >::container_t = DataVector<value_t> |
Definition at line 28 of file ContainerAccessor.h.
| using ContainerAccessor< value_t, identifier_t, inline_size >::Iterator = typename container_t::const_iterator |
Definition at line 29 of file ContainerAccessor.h.
| using ContainerAccessor< value_t, identifier_t, inline_size >::Range = std::pair<Iterator, Iterator> |
Definition at line 30 of file ContainerAccessor.h.
|
inline |
Constructor.
| values | Container type, based on value_t |
| mapper | Function used to access the identifier_t |
| max_ids | Expected maximum number of identifiers, to reserve enough space in the map and avoid re-hashing |
At construction, a map is filled with identifiers and corresponding ranges of objects in the container
Definition at line 41 of file ContainerAccessor.h.
|
default |
Default destructor.
|
delete |
Copy constructor, deleted.
|
inline |
|
inline |
Function to verify if a given identifier is present in the map, i.e.
was present in the input container.
| identifier | Input identifier to check. |
Definition at line 77 of file ContainerAccessor.h.
|
delete |
|
inline |
Function to return the list of ranges corresponding to a given identifier.
| identifier | Input identifier, used for returning the list of ranges from the map. |
Definition at line 69 of file ContainerAccessor.h.
|
private |
Definition at line 93 of file ContainerAccessor.h.
1.8.18