ATLAS Offline Software
Loading...
Searching...
No Matches
SGHiveMgrSvc.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef STOREGATE_HIVEMGRSVC_H
6#define STOREGATE_HIVEMGRSVC_H
7
8#include <vector>
9#include <string>
10#include <mutex>
11
12#include "GaudiKernel/Service.h"
13#include "GaudiKernel/ServiceHandle.h"
14#include "GaudiKernel/StatusCode.h"
15#include "GaudiKernel/IHiveWhiteBoard.h"
16
19
20class StoreGateSvc;
21class ISvcLocator;
22class HltEventLoopMgr; // friend
23
29namespace SG {
30class HiveMgrSvc : public extends<Service, IHiveWhiteBoard> {
31 friend class TestSGHiveMgrSvc;
32 friend class ::HltEventLoopMgr;
33public:
35
41 virtual StatusCode selectStore(size_t slotIndex) override;
42
48 virtual StatusCode clearStore(size_t slotIndex) override;
49
55 virtual StatusCode setNumberOfStores(size_t slots) override;
56
61 virtual size_t getNumberOfStores() const override;
62
69 virtual bool exists( const DataObjID& ) override;
70
77 virtual size_t allocateStore( int evtnumber ) override;
78
84 virtual StatusCode freeStore( size_t slotIndex ) override;
85
86
92 virtual size_t getPartitionNumber(int eventnumber) const override;
93
95 virtual size_t freeSlots() override;
96
98 virtual StatusCode initialize() override;
99 virtual StatusCode finalize() override;
100 virtual StatusCode start() override;
102
104 HiveMgrSvc(const std::string& name, ISvcLocator* svc);
105
106 virtual ~HiveMgrSvc() {}
107
108private:
117 static void setNumProcs(size_t numProcs);
118
120 size_t m_nSlots; //property settable also by setNumberOfStores
121 std::vector<SG::HiveEventSlot> m_slots;
122 mutable std::mutex m_mutex; //< protects m_slots access
123 std::atomic<size_t> m_freeSlots {0};
124
125};
126} //namespace SG
127#endif // STOREGATE_HIVEMGRSVC_H
AthenaMT event loop manager for running HLT online.
virtual StatusCode start() override
virtual size_t allocateStore(int evtnumber) override
Allocate a store slot for new event.
HiveMgrSvc(const std::string &name, ISvcLocator *svc)
Standard Service Constructor. sets active store to default event store.
virtual size_t getNumberOfStores() const override
Get the number of 'slots'.
static void setNumProcs(size_t numProcs)
Set number of concurrent processes.
virtual bool exists(const DataObjID &) override
Check if a data object exists in store.
virtual ~HiveMgrSvc()
std::atomic< size_t > m_freeSlots
virtual size_t freeSlots() override
Get free slots number.
virtual size_t getPartitionNumber(int eventnumber) const override
Get the slot number corresponding to a given event.
virtual StatusCode selectStore(size_t slotIndex) override
Activate an given 'slot' for all subsequent calls within the same thread id.
ServiceHandle< StoreGateSvc > m_hiveStore
std::mutex m_mutex
virtual StatusCode clearStore(size_t slotIndex) override
Clear a given 'slot'.
friend class TestSGHiveMgrSvc
virtual StatusCode setNumberOfStores(size_t slots) override
Set the number of 'slots'.
std::vector< SG::HiveEventSlot > m_slots
virtual StatusCode initialize() override
virtual StatusCode freeStore(size_t slotIndex) override
Free a store slot.
virtual StatusCode finalize() override
The Athena Transient Store API.
Forward declaration.