PStack  2.0
Stack trace printer for MSVC and GCC binaries
psystem::shared_library::loaded_function_base< T > Struct Template Reference

Common base class for all specializations of loaded_function. More...

Inheritance diagram for psystem::shared_library::loaded_function_base< T >:

Public Member Functions

 loaded_function_base (FARPROC proc)
 Construct a loaded_function from a function pointer. More...
 
void retarget (FARPROC proc) noexcept
 Re-assign a function pointer to this functor instance. More...
 
T * get_ptr () const noexcept
 Access the function pointer contained here directly. More...
 

Protected Attributes

T * m_function
 The function pointer that may be invoked.
 

Detailed Description

template<typename T>
struct psystem::shared_library::loaded_function_base< T >

Common base class for all specializations of loaded_function.

Template Parameters
TThe function signature that will be used to store the wrapped function.
Author
Matt Bisson
Date
19 November, 2015
Since
PSystem 2.0
Version
PSystem 2.0

Constructor & Destructor Documentation

template<typename T >
psystem::shared_library::loaded_function_base< T >::loaded_function_base ( FARPROC  proc)
inline

Construct a loaded_function from a function pointer.

Parameters
[in]procThe proceedure's address. Type safety is out the window; we must trust you. This may be nullptr.

Member Function Documentation

template<typename T >
T* psystem::shared_library::loaded_function_base< T >::get_ptr ( ) const
inlinenoexcept

Access the function pointer contained here directly.

Returns
This may return nullptr.
template<typename T >
void psystem::shared_library::loaded_function_base< T >::retarget ( FARPROC  proc)
inlinenoexcept

Re-assign a function pointer to this functor instance.

Not all users of loaded_function will know the memory address at construction time (think "lazy" initialization). This method allows them to assign the pointer at a later time.

Parameters
[in]procThe proceedure's address. Type safety is out the window; we must trust you. This may be nullptr.

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