Class to create callback objects, that can be passed to functions as callback function pointers. In other words, a pointer to the callback object can be "called", directly. A generic callback handler invoked by this object then allows iterating dynamically over the arguments once called back.
More...
#include <callback.hpp>
|
using | CallbackHandler = void(*)(MethodRef method, MemAddr data, const Parameters *params, uint8_t count, const Return *ret) |
|
using | HiddenParam = bool(*)(ValueType) |
|
Class to create callback objects, that can be passed to functions as callback function pointers. In other words, a pointer to the callback object can be "called", directly. A generic callback handler invoked by this object then allows iterating dynamically over the arguments once called back.
Definition at line 19 of file callback.hpp.
◆ JitCallback() [1/2]
plugify::JitCallback::JitCallback |
( |
std::weak_ptr< asmjit::JitRuntime > |
rt | ) |
|
|
explicit |
Constructor.
- Parameters
-
rt | Weak pointer to the asmjit::JitRuntime. |
◆ JitCallback() [2/2]
plugify::JitCallback::JitCallback |
( |
JitCallback && |
other | ) |
|
|
noexcept |
Move constructor.
- Parameters
-
other | Another instance of Callback. |
◆ GetError()
std::string_view plugify::JitCallback::GetError |
( |
| ) |
|
|
inlinenoexcept |
Get the error message, if any.
- Returns
- Error message.
Definition at line 190 of file callback.hpp.
◆ GetFunction()
MemAddr plugify::JitCallback::GetFunction |
( |
| ) |
const |
|
inlinenoexcept |
Get a dynamically created function.
- Returns
- Pointer to the already generated function.
- Note
- The returned pointer can be nullptr if function is not generate.
Definition at line 176 of file callback.hpp.
◆ GetJitFunc() [1/2]
MemAddr plugify::JitCallback::GetJitFunc |
( |
const asmjit::FuncSignature & |
sig, |
|
|
MethodRef |
method, |
|
|
CallbackHandler |
callback, |
|
|
MemAddr |
data, |
|
|
bool |
hidden |
|
) |
| |
Get a dynamically created callback function based on the raw signature.
- Parameters
-
sig | Function signature. |
method | Reference to the method. |
callback | Callback function. |
data | User data. |
hidden | If true, return will be pass as hidden argument. |
- Returns
- Pointer to the generated function.
◆ GetJitFunc() [2/2]
Get a dynamically created function based on the method reference.
- Parameters
-
method | Reference to the method. |
callback | Callback function. |
data | User data. |
hidden | If true, return will be pass as hidden argument. |
- Returns
- Pointer to the generated function.
Creates a new callback object, where method is a signature describing the function to be called back, and callback is a pointer to a generic callback handler (see below). The signature is needed in the generic callback handler to correctly retrieve the arguments provided by the caller of the callback. Note that the generic handler's function type/declaration is always the same for any callback. userdata is a pointer to arbitrary user data to be available in the generic callback handler.
◆ GetUserData()
MemAddr plugify::JitCallback::GetUserData |
( |
| ) |
const |
|
inlinenoexcept |
Get the user data associated with the object.
This function returns a pointer to the user data associated with the object.
- Returns
- A void pointer to the user data.
- Note
- The returned pointer can be nullptr if no user data is set.
Definition at line 184 of file callback.hpp.
The documentation for this class was generated from the following file: