peary::interface::iface_mem

Peary Memory Interface.

#include <peary/interfaces/Memory/memory.hpp>

Inherits from peary::interface::Interface< size_t, uintptr_t, iface_mem_config >

Inherited by peary::interface::iface_sermem

Public Functions

Name
iface_mem(const configuration_type & config)Type definition for the configuration object used by the Memory interface.
~iface_mem() overrideDestructor for iface_mem.
utils::memory_map mem() constGet the memory map.
iface_mem() =deleteDeleted default constructor to prevent instantiation without configuration.

Protected Functions

Name
virtual std::pair< size_t, uintptr_t > write(const std::pair< size_t, uintptr_t > & ) overrideWrite data to a memory location.
uintptr_t readWord(const size_t) constRead a word from a memory location.
virtual dataVector_type read(const size_t & , const unsigned int ) overrideRead multiple words from a memory location.

Public Attributes

Name
int _memfd
void * _mappedMemory

Friends

Name
iface_mem & InterfaceManager::getInterface(const configuration_type & ) Friend function to get an instance of iface_mem from the InterfaceManager.
void InterfaceManager::deleteInterface(iface_mem * ) Friend function to delete an instance of iface_mem from the InterfaceManager.

Additional inherited members

Public Types inherited from peary::interface::Interface< size_t, uintptr_t, iface_mem_config >

Name
using REG_T reg_type Type aliases for register type, data type, configuration type, and data vector type.
using DATA_T data_type
using CONFIG_T configuration_type
using std::vector< data_type > dataVector_type

Public Functions inherited from peary::interface::Interface< size_t, uintptr_t, iface_mem_config >

Name
std::string devicePath() constGet the device path associated with the interface.

Protected Functions inherited from peary::interface::Interface< size_t, uintptr_t, iface_mem_config >

Name
Interface(const InterfaceConfiguration & config)Constructor for Interface class.
virtual ~Interface() =defaultVirtual destructor for Interface class.

Public Functions Documentation

function iface_mem

  explicit iface_mem(
    const configuration_type & config
)
  

Type definition for the configuration object used by the Memory interface.

Parameters:

  • config The configuration object for the Memory interface

function ~iface_mem

  ~iface_mem() override
  

Destructor for iface_mem.

function mem

  inline utils::memory_map mem() const
  

Get the memory map.

Return: The memory map

function iface_mem

  iface_mem() =delete
  

Deleted default constructor to prevent instantiation without configuration.

Protected Functions Documentation

function write

  virtual std::pair< size_t, uintptr_t > write(
    const std::pair< size_t, uintptr_t > & 
) override
  

Write data to a memory location.

Reimplements: peary::interface::Interface::write

Reimplemented by: peary::interface::iface_sermem::write

function readWord

  uintptr_t readWord(
    const size_t
) const
  

Read a word from a memory location.

Return: The word read from the specified memory location

function read

  virtual dataVector_type read(
    const size_t & ,
    const unsigned int 
) override
  

Read multiple words from a memory location.

Return: A vector containing the words read from the specified memory location

Reimplements: peary::interface::Interface::read

Reimplemented by: peary::interface::iface_sermem::read

Public Attributes Documentation

variable _memfd

  int _memfd;
  

variable _mappedMemory

  void * _mappedMemory;
  

Friends

friend InterfaceManager::getInterface

  friend iface_mem & InterfaceManager::getInterface(
    const configuration_type & 
);
  

Friend function to get an instance of iface_mem from the InterfaceManager.

Return: A reference to the iface_mem instance

friend InterfaceManager::deleteInterface

  friend void InterfaceManager::deleteInterface(
    iface_mem * 
);
  

Friend function to delete an instance of iface_mem from the InterfaceManager.


Updated on 2025-11-14 at 11:31:23 +0100