Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
init_backend< Functions, Host, Impl > Struct Template Reference
Collaboration diagram for init_backend< Functions, Host, Impl >:

Public Types

using rhf_t = sysio::vm::registered_host_functions<Host, execution_interface, cnv<Host>>
 
using backend_t = sysio::vm::backend<rhf_t, Impl>
 

Public Member Functions

 init_backend (Host *host)
 
template<typename... A>
auto call_with_return (A &&... a)
 
template<typename... A>
auto call (A &&... a)
 
decltype(auto) get_context ()
 

Static Public Member Functions

static void init_host_functions ()
 
template<typename T >
static void add (const std::string &name)
 

Public Attributes

wasm_allocator wa
 
backend_t bkend {host_functions_tests_1_code, &wa}
 
Host * _host
 

Detailed Description

template<class Functions, class Host, class Impl>
struct init_backend< Functions, Host, Impl >

Definition at line 151 of file host_functions_tests.cpp.

Member Typedef Documentation

◆ backend_t

template<class Functions , class Host , class Impl >
using init_backend< Functions, Host, Impl >::backend_t = sysio::vm::backend<rhf_t, Impl>

Definition at line 199 of file host_functions_tests.cpp.

◆ rhf_t

template<class Functions , class Host , class Impl >
using init_backend< Functions, Host, Impl >::rhf_t = sysio::vm::registered_host_functions<Host, execution_interface, cnv<Host>>

Definition at line 198 of file host_functions_tests.cpp.

Constructor & Destructor Documentation

◆ init_backend()

template<class Functions , class Host , class Impl >
init_backend< Functions, Host, Impl >::init_backend ( Host * host)
inline

Definition at line 152 of file host_functions_tests.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ add()

template<class Functions , class Host , class Impl >
template<typename T >
static void init_backend< Functions, Host, Impl >::add ( const std::string & name)
inlinestatic

Definition at line 175 of file host_functions_tests.cpp.

175 {
176 rhf_t::template add<&Functions::template put<T>>("env", "put_" + name);
177 rhf_t::template add<&Functions::template get<T>>("env", "get_" + name);
178 }
std::string name
static void add(const std::string &name)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ call()

template<class Functions , class Host , class Impl >
template<typename... A>
auto init_backend< Functions, Host, Impl >::call ( A &&... a)
inline

Definition at line 189 of file host_functions_tests.cpp.

189 {
190 if constexpr (std::is_same_v<Host, std::nullptr_t>) {
191 return bkend.call(static_cast<A&&>(a)...);
192 } else {
193 return bkend.call(*_host, static_cast<A&&>(a)...);
194 }
195 }
bool call(host_t *host, uint32_t func_index, Args... args)
Definition backend.hpp:148
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
Definition pointer.h:1181
Here is the call graph for this function:

◆ call_with_return()

template<class Functions , class Host , class Impl >
template<typename... A>
auto init_backend< Functions, Host, Impl >::call_with_return ( A &&... a)
inline

Definition at line 181 of file host_functions_tests.cpp.

181 {
182 if constexpr (std::is_same_v<Host, std::nullptr_t>) {
183 return bkend.call_with_return(static_cast<A&&>(a)...);
184 } else {
185 return bkend.call_with_return(*_host, static_cast<A&&>(a)...);
186 }
187 }
auto call_with_return(host_t &host, const std::string_view &mod, const std::string_view &func, Args... args)
Definition backend.hpp:178
Here is the call graph for this function:

◆ get_context()

template<class Functions , class Host , class Impl >
decltype(auto) init_backend< Functions, Host, Impl >::get_context ( )
inline

Definition at line 196 of file host_functions_tests.cpp.

196{ return bkend.get_context(); }
auto & get_context()
Definition backend.hpp:250
Here is the call graph for this function:

◆ init_host_functions()

template<class Functions , class Host , class Impl >
static void init_backend< Functions, Host, Impl >::init_host_functions ( )
inlinestatic

Definition at line 156 of file host_functions_tests.cpp.

156 {
157 add<bool>("b");
158 add<int32_t>("i32");
159 add<uint32_t>("ui32");
160 add<int64_t>("i64");
161 add<uint64_t>("ui64");
162 add<float>("f32");
163 add<double>("f64");
164 add<char*>("ptr");
165 add<const char*>("cptr");
166 add<volatile char*>("vptr");
168 add<char&>("ref");
169 add<const char&>("cref");
170 add<volatile char&>("vref");
172 }
Here is the call graph for this function:

Member Data Documentation

◆ _host

template<class Functions , class Host , class Impl >
Host* init_backend< Functions, Host, Impl >::_host

Definition at line 202 of file host_functions_tests.cpp.

◆ bkend

template<class Functions , class Host , class Impl >
backend_t init_backend< Functions, Host, Impl >::bkend {host_functions_tests_1_code, &wa}

Definition at line 201 of file host_functions_tests.cpp.

◆ wa

template<class Functions , class Host , class Impl >
wasm_allocator init_backend< Functions, Host, Impl >::wa

Definition at line 200 of file host_functions_tests.cpp.


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