ATLAS Offline Software
Loading...
Searching...
No Matches
TrigCostDataStore.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef TRIGCOSTMONITOR_TRIGCOSTDATASTORE_H
6#define TRIGCOSTMONITOR_TRIGCOSTDATASTORE_H 1
7
8#include <tbb/concurrent_hash_map.h>
9#include <tbb/concurrent_vector.h>
10
12
14
15#include "GaudiKernel/EventContext.h"
16#include "AthViews/View.h"
17
27template<typename PAYLOAD>
29 public:
30
35
40
45 StatusCode initialize(size_t nSlots);
46
54 StatusCode insert(const AlgorithmIdentifier& ai, const PAYLOAD& payload,
55 MsgStream& msg);
56
64 template<typename ENTRY>
65 StatusCode push_back(const AlgorithmIdentifier& ai, ENTRY&& entry,
66 MsgStream& msg);
67
75 StatusCode retrieve(const AlgorithmIdentifier& ai,
76 typename tbb::concurrent_hash_map<AlgorithmIdentifier, PAYLOAD, AlgorithmIdentifierHashCompare>::const_accessor& payload,
77 MsgStream& msg) const;
78
85 StatusCode clear(const EventContext& context, MsgStream& msg);
86
95 StatusCode getIterators(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);
98
99 private:
100
107 StatusCode checkSlot(const size_t slot, MsgStream& msg) const;
108
109 std::vector< tbb::concurrent_hash_map< AlgorithmIdentifier, PAYLOAD, AlgorithmIdentifierHashCompare> > m_store;
110};
111
112#include "TrigCostDataStore.icc"
113
114#endif // TRIGCOSTMONITOR_TRIGCOSTDATASTORE_H
115
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.
MsgStream & msg
Definition testRead.cxx:32