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

Tool providing debugging functionality for memory resources. More...

#include <DebugMemoryResourceTool.h>

Inheritance diagram for AthDevice::DebugMemoryResourceTool:
Collaboration diagram for AthDevice::DebugMemoryResourceTool:

Public Member Functions

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

Private Attributes

std::unique_ptr< std::pmr::memory_resource > m_mr
 The memory resource that this tool uses.
Tool properties
ToolHandle< IMemoryResourceToolm_mrTool
 Underlying memory resource to use for allocations.

Detailed Description

Tool providing debugging functionality for memory resources.

Making use of vecmem::debug_memory_resource.

Definition at line 20 of file DebugMemoryResourceTool.h.

Member Function Documentation

◆ initialize()

StatusCode AthDevice::DebugMemoryResourceTool::initialize ( )
overridevirtual

Initialize the tool.

Definition at line 13 of file DebugMemoryResourceTool.cxx.

13 {
14
15 // Retrieve the upstream tool.
16 ATH_CHECK(m_mrTool.retrieve());
17
18 // Construct the debug resource around it.
19 m_mr = std::make_unique<vecmem::debug_memory_resource>(m_mrTool->mr());
20
21 // Return gracefully.
22 return StatusCode::SUCCESS;
23}
#define ATH_CHECK
Evaluate an expression and check for errors.
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.

◆ mr()

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

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

Definition at line 25 of file DebugMemoryResourceTool.cxx.

25 {
26
27 assert(m_mr);
28 return *m_mr;
29}

Member Data Documentation

◆ m_mr

std::unique_ptr<std::pmr::memory_resource> AthDevice::DebugMemoryResourceTool::m_mr
private

The memory resource that this tool uses.

Definition at line 45 of file DebugMemoryResourceTool.h.

◆ m_mrTool

ToolHandle<IMemoryResourceTool> AthDevice::DebugMemoryResourceTool::m_mrTool
private
Initial value:
{
this, "MRTool", "", "Memory resource tool to use for allocations"}

Underlying memory resource to use for allocations.

Definition at line 51 of file DebugMemoryResourceTool.h.

51 {
52 this, "MRTool", "", "Memory resource tool to use for allocations"};

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