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

Tool exposing a memory resource service as a memory resource tool. More...

#include <MemoryResourceSvcAdaptorTool.h>

Inheritance diagram for AthDevice::MemoryResourceSvcAdaptorTool:
Collaboration diagram for AthDevice::MemoryResourceSvcAdaptorTool:

Public Member Functions

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

Private Attributes

ServiceHandle< IMemoryResourceSvcm_mrSvc
 Handle to the service providing the underlying memory resource.

Detailed Description

Tool exposing a memory resource service as a memory resource tool.

Client components should ideally only use memory resources through the AthDevice::IMemoryResourceTool interface. But especially caching memory resources are best implemented as a service.

This tool allows us to expose such services with a tool interface.

Definition at line 25 of file MemoryResourceSvcAdaptorTool.h.

Member Function Documentation

◆ initialize()

StatusCode AthDevice::MemoryResourceSvcAdaptorTool::initialize ( )
overridevirtual

Initialize the tool.

Definition at line 13 of file MemoryResourceSvcAdaptorTool.cxx.

13 {
14
15 // Retrieve the "wrapped" service.
16 ATH_CHECK(m_mrSvc.retrieve());
17
18 // Return gracefully.
19 return StatusCode::SUCCESS;
20}
#define ATH_CHECK
Evaluate an expression and check for errors.
ServiceHandle< IMemoryResourceSvc > m_mrSvc
Handle to the service providing the underlying memory resource.

◆ mr()

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

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

Definition at line 22 of file MemoryResourceSvcAdaptorTool.cxx.

22 {
23
24 // Just return the memory resource provided by the service.
25 assert(m_mrSvc.isValid());
26 return m_mrSvc->mr();
27}

Member Data Documentation

◆ m_mrSvc

ServiceHandle<IMemoryResourceSvc> AthDevice::MemoryResourceSvcAdaptorTool::m_mrSvc
private
Initial value:
{
this, "MRSvc", "", "Service providing the 'adapted' memory resource"}

Handle to the service providing the underlying memory resource.

Definition at line 50 of file MemoryResourceSvcAdaptorTool.h.

50 {
51 this, "MRSvc", "", "Service providing the 'adapted' memory resource"};

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