maat::env::FunctionCallback class

A C/C++ or Python callback emulating an imported function.

❱   Public types

using return_t = std::variant<std::monostate, cst_t, Value>
Value returned by the function (if any)

using native_cb_t = std::add_pointer<return_t(MaatEngine&, const std::vector<Value>&)>::type
Native C/C++ callback.

❱   Constructors, destructors, conversion operators

FunctionCallback(const args_spec_t& args, native_cb_t callback)
Create a callback with a native function.

FunctionCallback(const FunctionCallback& other) defaulted
Copy constructor.

FunctionCallback(FunctionCallback&& other) defaulted
Move semantics.

❱   Public functions

auto operator=(const FunctionCallback& other) -> FunctionCallback& defaulted
Assignment operator.

auto operator=(FunctionCallback&& other) -> FunctionCallback& defaulted
Move assignment.

auto execute(MaatEngine& engine, const abi::ABI& abi, std::optional<std::string> func_wrapper_name = std::nullopt) const -> env::Action

❱   Function documentation

env::Action maat::env::FunctionCallback::execute(MaatEngine& engine, const abi::ABI& abi, std::optional<std::string> func_wrapper_name = std::nullopt) const

Parameters
engine
abi ABI to use to get function arguments and return from the function
func_wrapper_name Optional function name to use to log the function call. If unspecified the call will not be logged

Run the function callback