ATLAS Offline Software
Loading...
Searching...
No Matches
HiveExSvc.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
9
10
11#ifndef HIVEEXSVC_H
12#define HIVEEXSVC_H 1
13
15#include "GaudiKernel/ContextSpecificPtr.h"
17
18#include <string>
19#include <vector>
20#include <list>
21#include <mutex>
22#include <memory>
23
24class HiveExSvc : public extends<AthService,IHiveExSvc> {
25
26public:
27 HiveExSvc(const std::string& name, ISvcLocator* svc);
28 virtual ~HiveExSvc();
29
30 virtual StatusCode initialize() override;
31 virtual StatusCode finalize() override;
32
33 virtual void add(const std::string&, const unsigned int&) override;
34
35private:
36
37 // data structure to hold timing info
38 struct tDat {
39 tDat(const std::string& n, const unsigned int& t): algName(n), sleep_time(t){};
40 std::string algName {""};
41 unsigned int sleep_time {0};
42 };
43
44 // vector of time data, one entry per event slot
45 std::vector< std::list<tDat> > m_times;
46
47 // can't use a simple vector of mutexes, as the aren't copy/move
48 // contructible
49 std::vector< std::unique_ptr<std::mutex> > m_locks;
50
51};
52
53#endif
Abstract Interface class for HiveExSvc, that accumualtes Algorithm run times by name.
virtual ~HiveExSvc()
std::vector< std::unique_ptr< std::mutex > > m_locks
Definition HiveExSvc.h:49
std::vector< std::list< tDat > > m_times
Definition HiveExSvc.h:45
HiveExSvc(const std::string &name, ISvcLocator *svc)
Definition HiveExSvc.cxx:14
virtual StatusCode finalize() override
Definition HiveExSvc.cxx:46
virtual StatusCode initialize() override
Definition HiveExSvc.cxx:24
virtual void add(const std::string &, const unsigned int &) override
Definition HiveExSvc.cxx:77
tDat(const std::string &n, const unsigned int &t)
Definition HiveExSvc.h:39
unsigned int sleep_time
Definition HiveExSvc.h:41
std::string algName
Definition HiveExSvc.h:40