libintrovirt v0.57.4
IntroVirt introspection library
Loading...
Searching...
No Matches
introvirt::GuestMemoryMapping Class Referencefinal

A mapping of guest memory. More...

#include <GuestMemoryMapping.hh>

Public Member Functions

void * get ()
 Get the raw memory mapping.
 
const void * get () const
 Get the raw memory mapping.
 
unsigned int length () const
 Returns the number of bytes that are mapped.
 
 GuestMemoryMapping ()
 Construct a "null" GuestMemoryMapping.
 
 GuestMemoryMapping (void *mapping, unsigned int length)
 Construct a GuestMemoryMapping.
 
 GuestMemoryMapping (const GuestMemoryMapping &)=delete
 Copy constructor.
 
GuestMemoryMappingoperator= (const GuestMemoryMapping &)=delete
 Copy assignment operator.
 
 GuestMemoryMapping (GuestMemoryMapping &&) noexcept
 Move constructor.
 
GuestMemoryMappingoperator= (GuestMemoryMapping &&) noexcept HOT
 Move assignment operator.
 
 ~GuestMemoryMapping () HOT
 Destroy the instance The memory will be unmapped.
 

Detailed Description

A mapping of guest memory.

A wrapper class to hold a mapping of guest memory. Generally you would use a guest_ptr instead of directly using this class.

Keep in mind that since we have to map entire pages of memory, you will have to offset into the buffer returned by get().

Constructor & Destructor Documentation

◆ GuestMemoryMapping() [1/4]

introvirt::GuestMemoryMapping::GuestMemoryMapping ( )
inline

Construct a "null" GuestMemoryMapping.

◆ GuestMemoryMapping() [2/4]

introvirt::GuestMemoryMapping::GuestMemoryMapping ( void *  mapping,
unsigned int  length 
)
inline

Construct a GuestMemoryMapping.

Parameters
mappingThe mapped guest memory
lengthThe number of bytes that have been mapped

◆ GuestMemoryMapping() [3/4]

introvirt::GuestMemoryMapping::GuestMemoryMapping ( const GuestMemoryMapping )
delete

Copy constructor.

◆ GuestMemoryMapping() [4/4]

introvirt::GuestMemoryMapping::GuestMemoryMapping ( GuestMemoryMapping &&  )
noexcept

Move constructor.

◆ ~GuestMemoryMapping()

introvirt::GuestMemoryMapping::~GuestMemoryMapping ( )

Destroy the instance The memory will be unmapped.

Member Function Documentation

◆ get() [1/2]

void * introvirt::GuestMemoryMapping::get ( )
inline

Get the raw memory mapping.

Returns
The raw memory mapping

◆ get() [2/2]

const void * introvirt::GuestMemoryMapping::get ( ) const
inline

Get the raw memory mapping.

Returns
A const version of the raw memory mapping

◆ length()

unsigned int introvirt::GuestMemoryMapping::length ( ) const
inline

Returns the number of bytes that are mapped.

Returns
unsigned int

◆ operator=() [1/2]

GuestMemoryMapping & introvirt::GuestMemoryMapping::operator= ( const GuestMemoryMapping )
delete

Copy assignment operator.

◆ operator=() [2/2]

GuestMemoryMapping & introvirt::GuestMemoryMapping::operator= ( GuestMemoryMapping &&  )
noexcept

Move assignment operator.


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