ADTF  3.18.2
AddressInfo

Address info class This class can be used to query information about a memory address (e.g. More...

Public Member Functions

template<typename ReturnType , typename... Args>
 AddressInfo (ReturnType(*const function)(Args...)) noexcept
 Constructor for function addresses.
 
template<typename T >
 AddressInfo (const T &variable) noexcept
 Constructor for global or static variables addresses. More...
 
filesystem::Path getFilePath () const
 Get the fully qualified file path to the executable or shared library the address is located in. More...
 

Private Member Functions

template<typename Return , typename... Args>
const_handle_t toDataPointer (Return(*const function)(Args...)) noexcept
 Casts a function pointer to a data pointer. More...
 

Private Attributes

const_handle_t _address
 

Detailed Description

Address info class This class can be used to query information about a memory address (e.g.

the file path of the binary where the address is located in)

Definition at line 26 of file address_info.h.

Constructor & Destructor Documentation

◆ AddressInfo()

AddressInfo ( const T &  variable)
inlineexplicitnoexcept

Constructor for global or static variables addresses.

Warning
variable must not be a heap or stack variable!

Definition at line 56 of file address_info.h.

Member Function Documentation

◆ getFilePath()

filesystem::Path getFilePath ( ) const

Get the fully qualified file path to the executable or shared library the address is located in.

Returns
File path of the binary the address is located in (e.g. "C:\dir\test.exe", "C:\dir\test.dll", "netdrive\test.exe" or "\\netdrive\test.so"). Might be empty if an error occurs.

◆ toDataPointer()

const_handle_t toDataPointer ( Return(*)(Args...)  function)
inlineprivatenoexcept

Casts a function pointer to a data pointer.

Author
Johannes Schaub - litb here: https://stackoverflow.com/a/1306125/411641

Definition at line 82 of file address_info.h.

Referenced by AddressInfo::AddressInfo().