5#ifndef TRIGCOSTMONITOR_TRIGCOSTDATASTORE_H
6#define TRIGCOSTMONITOR_TRIGCOSTDATASTORE_H 1
8#include <tbb/concurrent_hash_map.h>
9#include <tbb/concurrent_vector.h>
15#include "GaudiKernel/EventContext.h"
27template<
typename PAYLOAD>
64 template<
typename ENTRY>
76 typename tbb::concurrent_hash_map<AlgorithmIdentifier, PAYLOAD, AlgorithmIdentifierHashCompare>::const_accessor& payload,
77 MsgStream&
msg)
const;
85 StatusCode
clear(
const EventContext& context, MsgStream&
msg);
96 typename tbb::concurrent_hash_map< AlgorithmIdentifier, PAYLOAD, AlgorithmIdentifierHashCompare>::const_iterator& begin,
97 typename tbb::concurrent_hash_map< AlgorithmIdentifier, PAYLOAD, AlgorithmIdentifierHashCompare>::const_iterator& end);
109 std::vector< tbb::concurrent_hash_map< AlgorithmIdentifier, PAYLOAD, AlgorithmIdentifierHashCompare> >
m_store;
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.
TrigCostDataStore()
Default constructor.
std::vector< tbb::concurrent_hash_map< AlgorithmIdentifier, PAYLOAD, AlgorithmIdentifierHashCompare > > m_store
Underlying thread-safe data store for all slots: vector< hashmap< AlgorithmIdentifier,...
StatusCode insert(const AlgorithmIdentifier &ai, const PAYLOAD &payload, MsgStream &msg)
Inserts the payload into the map.
StatusCode checkSlot(const size_t slot, MsgStream &msg) const
Internal check that the supplied slot number is in range.
StatusCode initialize(size_t nSlots)
Initialise internal storage.
~TrigCostDataStore()
Destructor.
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.
StatusCode clear(const EventContext &context, MsgStream &msg)
Clears all data stored in an event slot.
StatusCode push_back(const AlgorithmIdentifier &ai, ENTRY &&entry, MsgStream &msg)
Inserts the entry in the vector payload into the map.
Small structure to hold an algorithm's name and store, plus some details on its EventView.