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>
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.
◆ CallbackHandler
◆ HiddenParam
using plugify::JitCallback::HiddenParam = bool(*)(ValueType) |
◆ JitCallback() [1/3]
plugify::JitCallback::JitCallback |
( |
std::weak_ptr< asmjit::JitRuntime > |
rt | ) |
|
|
explicit |
Constructor.
- Parameters
-
rt | Weak pointer to the asmjit::JitRuntime. |
◆ JitCallback() [2/3]
plugify::JitCallback::JitCallback |
( |
const JitCallback & |
other | ) |
|
|
delete |
Copy constructor.
- Parameters
-
other | Another instance of Callback. |
◆ JitCallback() [3/3]
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 196 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 182 of file callback.hpp.
◆ GetJitFunc() [1/2]
MemAddr plugify::JitCallback::GetJitFunc |
( |
const asmjit::FuncSignature & |
sig, |
|
|
MethodHandle |
method, |
|
|
CallbackHandler |
callback, |
|
|
MemAddr |
data, |
|
|
bool |
hidden |
|
) |
| |
Get a dynamically created callback function based on the raw signature.
- Parameters
-
sig | Function signature. |
method | Handle 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.
- Parameters
-
method | Handle 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 190 of file callback.hpp.
◆ operator=() [1/2]
Copy assignment operator for JitCallback.
- Parameters
-
- Returns
- A reference to this instance after copying.
◆ operator=() [2/2]
Move assignment operator for JitCall.
- Parameters
-
- Returns
- A reference to this instance after moving.
- Note
- This operator is marked noexcept to indicate it does not throw exceptions.
◆ _errorCode
const char* plugify::JitCallback::_errorCode {} |
◆ _userData
MemAddr plugify::JitCallback::_userData |
The documentation for this class was generated from the following file: