peary::utils::memory_map

Class to represent a memory map. More…

#include <peary/utils/datatypes.hpp>

Public Functions

Name
memory_map(std::uintptr_t base_address, std::size_t size, int flags =PROT_READ)Default constructor for memory_map.
std::uintptr_t getBaseAddress() constGet the base address of the memory map.
std::size_t getSize() constGet the size of the memory map.
int getFlags() constGet the flags for memory protection.
bool writable() constCheck if the memory map is writable.
bool operator<(const memory_map & other) constComparison operator for memory_map.

Detailed Description

  class peary::utils::memory_map;
  

Class to represent a memory map.

This class is used to represent a memory map, which includes the base address, size, and flags for memory protection.

Public Functions Documentation

function memory_map

  inline memory_map(
    std::uintptr_t base_address,
    std::size_t size,
    int flags =PROT_READ
)
  

Default constructor for memory_map.

Parameters:

  • base_address The base address of the memory map
  • size The size of the memory map
  • flags The flags for memory protection (default is PROT_READ)

function getBaseAddress

  inline std::uintptr_t getBaseAddress() const
  

Get the base address of the memory map.

Return: The base address of the memory map

function getSize

  inline std::size_t getSize() const
  

Get the size of the memory map.

Return: The size of the memory map

function getFlags

  inline int getFlags() const
  

Get the flags for memory protection.

Return: The flags for memory protection

function writable

  inline bool writable() const
  

Check if the memory map is writable.

Return: True if the memory map is writable, false otherwise

function operator<

  inline bool operator<(
    const memory_map & other
) const
  

Comparison operator for memory_map.

Parameters:

  • other The other memory_map object to compare with

This operator compares two memory_map objects based on their base address, size, and flags.


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