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
44 private:
46 ToolHandle<IMemoryResourceTool> m_mrTool{
47 this, "MRTool", "", "Tool providing the memory resource to be cached"};
48
49 std::unique_ptr<std::pmr::memory_resource> m_cachedMR;
51 std::unique_ptr<std::pmr::memory_resource> m_syncedMR;
52
53}; // class BinaryPageMemoryResourceSvc
54
55} // namespace AthDevice
56
57#endif // ATHDEVICECOMPS_BINARYPAGEMEMORYRESOURCESVC_H
Service implementing "binary page" caching on top of another memory resource.
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 tool.
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.