libcppwrap
A collection of C++ wrappers for native APIs
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
w::memory_region Struct Reference

A structure holding details about a memory-mapped file or device. More...

#include <posix.hpp>

Collaboration diagram for w::memory_region:
Collaboration graph
[legend]

Public Member Functions

constexpr memory_region (void *address, std::size_t length) noexcept
 Constructs a memory region. More...
 
constexpr memory_region () noexcept
 Constructs an empty memory region. More...
 
constexpr bool operator!= (const memory_region &rhs) const noexcept
 Compares two memory regions. More...
 

Public Attributes

void * address
 The (actual, not requested) base address of the mapping. More...
 
std::size_t length
 The length of the mapping in bytes. More...
 

Detailed Description

A structure holding details about a memory-mapped file or device.

Such a structure is the resource type of a w::mmap_handle RAII handle.

Constructor & Destructor Documentation

◆ memory_region() [1/2]

constexpr w::memory_region::memory_region ( void *  address,
std::size_t  length 
)
inlineconstexprnoexcept

Constructs a memory region.

Parameters
addressThe (actual, not requested) base address of the mapping.
Thelength of the mapping in bytes.

◆ memory_region() [2/2]

constexpr w::memory_region::memory_region ( )
inlineconstexprnoexcept

Constructs an empty memory region.

Member Function Documentation

◆ operator!=()

constexpr bool w::memory_region::operator!= ( const memory_region rhs) const
inlineconstexprnoexcept

Compares two memory regions.

Parameters
rhsA reference to the memory region to compare.
Returns
false if this object and rhs both have the same address and length.

Member Data Documentation

◆ address

void* w::memory_region::address

The (actual, not requested) base address of the mapping.

◆ length

std::size_t w::memory_region::length

The length of the mapping in bytes.


The documentation for this struct was generated from the following file: