24 #ifndef _VM_DISPATCH_HH_
25 #define _VM_DISPATCH_HH_
45 const std::string& type_name,
const VMDispatcherFunc & find_dispatcher(const std::string &type_name)
finds the dispatcher function for a given type
std::function< VMValue(const VMFuncName &, const VMFuncArgs &)> VMDispatcherFunc
Data type for dispatcher function pointer.
void reg_dispatcher(const std::string &type_name, const VMDispatcherFunc &func)
registers a dispatcher function for a VATA data type
std::string VMFuncName
Data type for function names.
std::vector< VMValue > VMFuncArgs
Data type for function arguments.
std::string type
name of the type
VMValue call_dispatch_with_self(const VMValue &val, const VMFuncName &func_name)
calls a dispatcher function for the given value with it as the only argument
Data type representing a value, which is composed of a type and a pointer to a general memory...
VMValue default_dispatch(const VMFuncName &func_name, const VMFuncArgs &func_args)
Default dispatcher function.