ATLAS Offline Software
Loading...
Searching...
No Matches
BinaryPageMemoryResourceSvc.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_BINARYPAGEMEMORYRESOURCESVC_H
5#define ATHDEVICECOMPS_BINARYPAGEMEMORYRESOURCESVC_H
6
7// Framework include(s).
9#include "GaudiKernel/ToolHandle.h"
10
11// AthDevice include(s).
14
15namespace AthDevice {
16
22 : public extends<AthService, IMemoryResourceSvc> {
23
24 public:
25 // Inherit the base class's constructor(s).
26 using extends::extends;
27
30
32 virtual StatusCode initialize() override;
33
35
38
40 virtual std::pmr::memory_resource& mr() const override;
41
43 virtual std::string_view deviceName() const override;
44
46
47 private:
49 ToolHandle<IMemoryResourceTool> m_mrTool{
50 this, "MRTool", "", "Tool providing the memory resource to be cached"};
51
52 std::unique_ptr<std::pmr::memory_resource> m_cachedMR;
54 std::unique_ptr<std::pmr::memory_resource> m_syncedMR;
55
56}; // class BinaryPageMemoryResourceSvc
57
58} // namespace AthDevice
59
60#endif // ATHDEVICECOMPS_BINARYPAGEMEMORYRESOURCESVC_H
Service implementing "binary page" caching on top of another memory resource.
virtual std::string_view deviceName() const override
The name of the device for which the memory resource is provided.
std::unique_ptr< std::pmr::memory_resource > m_cachedMR
The memory resource that this tool uses for caching.
virtual std::pmr::memory_resource & mr() const override
Get the provided std::pmr::memory_resource object.
virtual StatusCode initialize() override
Initialize the service.
ToolHandle< IMemoryResourceTool > m_mrTool
Handle to the tool providing the underlying memory resource.
std::unique_ptr< std::pmr::memory_resource > m_syncedMR
The memory resource that this tool uses for synchronization.