![]() |
ATLAS Offline Software
|
Thread safe and multi-slot hash-map to cache PAYLOAD objects/primitives during event execution. More...
#include <TrigCostDataStore.h>
Public Member Functions | |
TrigCostDataStore () | |
Default constructor. More... | |
~TrigCostDataStore () | |
Destructor. More... | |
StatusCode | initialize (size_t nSlots) |
Initialise internal storage. More... | |
StatusCode | insert (const AlgorithmIdentifier &ai, const PAYLOAD &payload, MsgStream &msg) |
Inserts the payload into the map. More... | |
template<typename ENTRY > | |
StatusCode | push_back (const AlgorithmIdentifier &ai, ENTRY &&entry, MsgStream &msg) |
Inserts the entry in the vector payload into the map. More... | |
StatusCode | retrieve (const AlgorithmIdentifier &ai, typename tbb::concurrent_hash_map< AlgorithmIdentifier, PAYLOAD, AlgorithmIdentifierHashCompare >::const_accessor &payload, MsgStream &msg) const |
Retrieve a payload from the map given an AlgorithmIdentifier. More... | |
StatusCode | clear (const EventContext &context, MsgStream &msg) |
Clears all data stored in an event slot. More... | |
StatusCode | getIterators (const EventContext &context, MsgStream &msg, typename tbb::concurrent_hash_map< AlgorithmIdentifier, PAYLOAD, AlgorithmIdentifierHashCompare >::const_iterator &begin, typename tbb::concurrent_hash_map< AlgorithmIdentifier, PAYLOAD, AlgorithmIdentifierHashCompare >::const_iterator &end) |
Fetches Begin and End const iterators to iterate over the data store. More... | |
Private Member Functions | |
StatusCode | checkSlot (const size_t slot, MsgStream &msg) const |
Internal check that the supplied slot number is in range. More... | |
Private Attributes | |
std::vector< tbb::concurrent_hash_map< AlgorithmIdentifier, PAYLOAD, AlgorithmIdentifierHashCompare > > | m_store |
Underlying thread-safe data store for all slots: vector< hashmap< AlgorithmIdentifier, payload > > More... | |
Thread safe and multi-slot hash-map to cache PAYLOAD objects/primitives during event execution.
The PAYLOAD objects are later used to construct a trigger cost summary for the event. Data are partitioned based on the slot of the event context and both the name and store of the audited algorithm, these three pieces of data uniquely identify an algorithm execution.
Definition at line 28 of file TrigCostDataStore.h.
|
inline |
|
inline |
|
private |
Internal check that the supplied slot number is in range.
[in] | slot | Event context slot ID |
[in] | msg | Message service reference |
StatusCode TrigCostDataStore< PAYLOAD >::clear | ( | const EventContext & | context, |
MsgStream & | msg | ||
) |
Clears all data stored in an event slot.
[in] | context | The event context of the slot to clear |
[in] | msg | Message service reference |
StatusCode TrigCostDataStore< PAYLOAD >::getIterators | ( | const EventContext & | context, |
MsgStream & | msg, | ||
typename tbb::concurrent_hash_map< AlgorithmIdentifier, PAYLOAD, AlgorithmIdentifierHashCompare >::const_iterator & | begin, | ||
typename tbb::concurrent_hash_map< AlgorithmIdentifier, PAYLOAD, AlgorithmIdentifierHashCompare >::const_iterator & | end | ||
) |
Fetches Begin and End const iterators to iterate over the data store.
[in] | context | The event context of the slot to return iterators over |
[in] | msg | Message service reference |
[out] | begin | Return of iterator to start of map |
[out] | end | Return of iterator to end of map |
StatusCode TrigCostDataStore< PAYLOAD >::initialize | ( | size_t | nSlots | ) |
Initialise internal storage.
[in] | nSlots. | Number of possible concurrent slots to reserve space for. |
StatusCode TrigCostDataStore< PAYLOAD >::insert | ( | const AlgorithmIdentifier & | ai, |
const PAYLOAD & | payload, | ||
MsgStream & | msg | ||
) |
Inserts the payload into the map.
[in] | ai | The AlgorithmIdentifier to insert for (the key) |
[in] | payload | The payload to record |
[in] | msg | a reference to the msgstream for printing |
StatusCode TrigCostDataStore< PAYLOAD >::push_back | ( | const AlgorithmIdentifier & | ai, |
ENTRY && | entry, | ||
MsgStream & | msg | ||
) |
Inserts the entry in the vector payload into the map.
[in] | ai | The AlgorithmIdentifier to insert for (the key) |
[in] | entry | The entry to record |
[in] | msg | a reference to the msgstream for printing |
StatusCode TrigCostDataStore< PAYLOAD >::retrieve | ( | const AlgorithmIdentifier & | ai, |
typename tbb::concurrent_hash_map< AlgorithmIdentifier, PAYLOAD, AlgorithmIdentifierHashCompare >::const_accessor & | payload, | ||
MsgStream & | msg | ||
) | const |
Retrieve a payload from the map given an AlgorithmIdentifier.
[in] | ai | The AlgorithmIdentifier to fetch (the key) |
[out] | payload | Reference to const_accessor to payload to return |
[in] | msg | a reference to the msgstream for printing |
|
private |
Underlying thread-safe data store for all slots: vector< hashmap< AlgorithmIdentifier, payload > >
Definition at line 109 of file TrigCostDataStore.h.