ATLAS Offline Software
Loading...
Searching...
No Matches
MonitoredMemoryResourceTool.h
Go to the documentation of this file.
1//
2// Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3//
4#ifndef ATHDEVICECOMPS_MONITOREDMEMORYRESOURCETOOL_H
5#define ATHDEVICECOMPS_MONITOREDMEMORYRESOURCETOOL_H
6
7// Framework include(s).
9#include "GaudiKernel/ToolHandle.h"
10
11// AthDevice include(s).
14
15namespace AthDevice {
16
23 : public extends<AthAlgTool, AthDevice::IMemoryResourceTool> {
24
25 public:
26 // Inherit the base class's constructor(s).
27 using extends::extends;
28
31
33 virtual StatusCode initialize() override;
34
36
39
41 virtual std::pmr::memory_resource& mr() const override;
42
44 virtual std::string_view deviceName() const override;
45
47
48 private:
50 std::unique_ptr<std::pmr::memory_resource> m_mr;
51
54
56 ToolHandle<IMemoryResourceTool> m_mrTool{
57 this, "MRTool", "", "Memory resource tool to use for allocations"};
58
61 this, "MonitorSvc", "AthDevice::MemoryMonitorSvc",
62 "Memory monitor service to collect the monitoring information"};
63
65
66}; // class MonitoredMemoryResourceTool
67
68} // namespace AthDevice
69
70#endif // ATHDEVICECOMPS_MONITOREDMEMORYRESOURCETOOL_H
Tool providing monitoring functionality for memory resources.
ServiceHandle< IMemoryMonitorSvc > m_monitorSvc
Service collecting the memory monitoring information.
virtual StatusCode initialize() override
Initialize the tool.
std::unique_ptr< std::pmr::memory_resource > m_mr
The memory resource that this tool uses.
ToolHandle< IMemoryResourceTool > m_mrTool
Underlying memory resource to use for allocations.
virtual std::pmr::memory_resource & mr() const override
Get the provided std::pmr::memory_resource object.
virtual std::string_view deviceName() const override
The name of the device for which the memory resource is provided.