ATLAS Offline Software
Loading...
Searching...
No Matches
AthDevice::BinaryPageMemoryResourceSvc Class Reference

Service implementing "binary page" caching on top of another memory resource. More...

#include <BinaryPageMemoryResourceSvc.h>

Inheritance diagram for AthDevice::BinaryPageMemoryResourceSvc:
Collaboration diagram for AthDevice::BinaryPageMemoryResourceSvc:

Public Member Functions

Function(s) inherited from @c AthService
virtual StatusCode initialize () override
 Initialize the tool.
Function(s) inherited from @c IMemoryResourceSvc
virtual std::pmr::memory_resource & mr () const override
 Get the provided std::pmr::memory_resource object.

Private Attributes

ToolHandle< IMemoryResourceToolm_mrTool
 Handle to the tool providing the underlying memory resource.
std::unique_ptr< std::pmr::memory_resource > m_cachedMR
 The memory resource that this tool uses for caching.
std::unique_ptr< std::pmr::memory_resource > m_syncedMR
 The memory resource that this tool uses for synchronization.

Detailed Description

Service implementing "binary page" caching on top of another memory resource.

Making use of vecmem::binary_page_memory_resource.

Definition at line 21 of file BinaryPageMemoryResourceSvc.h.

Member Function Documentation

◆ initialize()

StatusCode AthDevice::BinaryPageMemoryResourceSvc::initialize ( )
overridevirtual

Initialize the tool.

Definition at line 17 of file BinaryPageMemoryResourceSvc.cxx.

17 {
18
19 // Retrieve the upstream memory resource tool.
20 ATH_CHECK(m_mrTool.retrieve());
21
22 // Construct the cached and synchronized memory resources around this upstream
23 // memory resource.
25 std::make_unique<vecmem::binary_page_memory_resource>(m_mrTool->mr());
27 std::make_unique<vecmem::synchronized_memory_resource>(*m_cachedMR);
28
29 // Return gracefully.
30 return StatusCode::SUCCESS;
31}
#define ATH_CHECK
Evaluate an expression and check for errors.
std::unique_ptr< std::pmr::memory_resource > m_cachedMR
The memory resource that this tool uses for caching.
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.

◆ mr()

std::pmr::memory_resource & AthDevice::BinaryPageMemoryResourceSvc::mr ( ) const
overridevirtual

Get the provided std::pmr::memory_resource object.

Definition at line 33 of file BinaryPageMemoryResourceSvc.cxx.

33 {
34
35 assert(m_cachedMR);
36 assert(m_syncedMR);
37 return *m_syncedMR;
38}

Member Data Documentation

◆ m_cachedMR

std::unique_ptr<std::pmr::memory_resource> AthDevice::BinaryPageMemoryResourceSvc::m_cachedMR
private

The memory resource that this tool uses for caching.

Definition at line 49 of file BinaryPageMemoryResourceSvc.h.

◆ m_mrTool

ToolHandle<IMemoryResourceTool> AthDevice::BinaryPageMemoryResourceSvc::m_mrTool
private
Initial value:
{
this, "MRTool", "", "Tool providing the memory resource to be cached"}

Handle to the tool providing the underlying memory resource.

Definition at line 46 of file BinaryPageMemoryResourceSvc.h.

46 {
47 this, "MRTool", "", "Tool providing the memory resource to be cached"};

◆ m_syncedMR

std::unique_ptr<std::pmr::memory_resource> AthDevice::BinaryPageMemoryResourceSvc::m_syncedMR
private

The memory resource that this tool uses for synchronization.

Definition at line 51 of file BinaryPageMemoryResourceSvc.h.


The documentation for this class was generated from the following files: