ug4
ug::bridge::ExportedMethod Class Reference

#include <class.h>

+ Inheritance diagram for ug::bridge::ExportedMethod:

Public Types

typedef void(* ProxyFunc) (const MethodPtrWrapper &func, void *obj, const ParameterStack &in, ParameterStack &out)
 

Public Member Functions

const std::string & class_name () const
 returns the class name this method belongs to More...
 
template<typename TFunc >
void create_parameter_stack ()
 
void execute (void *obj, const ParameterStack &paramsIn, ParameterStack &paramsOut) const
 executes the function More...
 
 ExportedMethod (const MethodPtrWrapper &m, ProxyFunc pf, const std::string &name, const std::string &className, const std::string &methodOptions, const std::string &retValInfos, const std::string &paramInfos, const std::string &tooltip, const std::string &help)
 
bool has_custom_return () const
 returns true if this method handles its own return of values to lua More...
 
- Public Member Functions inherited from ug::bridge::ExportedFunctionBase
bool check_consistency (std::string classname="") const
 returns true if all parameters of the function are correctly declared More...
 
 ExportedFunctionBase (const std::string &funcName, const std::string &funcOptions, const std::string &retValInfos, const std::string &paramInfos, const std::string &tooltip, const std::string &help)
 
const std::string & help () const
 help informations More...
 
const std::string & name () const
 name of function More...
 
size_t num_infos (size_t i) const
 number of info strings for one parameter More...
 
size_t num_parameter () const
 number of parameters. More...
 
const std::string & options () const
 name of function More...
 
const char * parameter_class_name (size_t i) const
 class name of parameter i More...
 
const std::string & parameter_info (size_t i, size_t j) const
 type info of all parameters More...
 
const std::string & parameter_info_string () const
 whole string of all type infos for of all parameters More...
 
const std::vector< std::string > & parameter_info_vec (size_t i) const
 type info of i th parameters More...
 
const std::string & parameter_name (size_t i) const
 name of parameter i More...
 
ParameterInfoparams_in ()
 non-const export of param list More...
 
const ParameterInfoparams_in () const
 parameter list for input values More...
 
const ParameterInfoparams_out () const
 parameter list for input values More...
 
const std::string & return_info (size_t i) const
 type info of return type More...
 
const std::vector< std::string > & return_info_vec () const
 type info of return value More...
 
const std::string & return_name () const
 name of return value More...
 
const std::string & tooltip () const
 gives some information to the exported functions More...
 

Private Attributes

std::string m_className
 name of class this method belongs to More...
 
bool m_customReturn
 
ProxyFunc m_proxy_func
 proxy function to call method More...
 
MethodPtrWrapper m_ptrWrapper
 pointer to function (stored in a wrapper) More...
 

Additional Inherited Members

- Protected Member Functions inherited from ug::bridge::ExportedFunctionBase
template<typename TFunc >
void create_parameter_stack ()
 
void tokenize (const std::string &str, std::vector< std::string > &tokens, const char delimiter)
 
- Protected Attributes inherited from ug::bridge::ExportedFunctionBase
std::string m_help
 
std::string m_methodOptions
 
std::string m_name
 
std::string m_paramInfos
 
ParameterInfo m_paramsIn
 
ParameterInfo m_paramsOut
 
std::string m_retValInfos
 
std::string m_tooltip
 
std::vector< std::string > m_vRetValInfo
 
std::vector< std::vector< std::string > > m_vvParamInfo
 

Detailed Description

function exported from ug This class describes a wrapper for a c++ - function, that is exported by ug

Member Typedef Documentation

◆ ProxyFunc

typedef void(* ug::bridge::ExportedMethod::ProxyFunc) (const MethodPtrWrapper &func, void *obj, const ParameterStack &in, ParameterStack &out)

Constructor & Destructor Documentation

◆ ExportedMethod()

ug::bridge::ExportedMethod::ExportedMethod ( const MethodPtrWrapper m,
ProxyFunc  pf,
const std::string &  name,
const std::string &  className,
const std::string &  methodOptions,
const std::string &  retValInfos,
const std::string &  paramInfos,
const std::string &  tooltip,
const std::string &  help 
)
inline

Member Function Documentation

◆ class_name()

const std::string& ug::bridge::ExportedMethod::class_name ( ) const
inline

returns the class name this method belongs to

References m_className.

Referenced by ug::bridge::lua::ExecuteMethod(), and Java_edu_gcsc_vrl_ug_UG__1invokeMethod().

◆ create_parameter_stack()

template<typename TFunc >
void ug::bridge::ExportedMethod::create_parameter_stack ( )
inline
Todo:
: replace this method with a better integrated way.

References m_customReturn.

◆ execute()

void ug::bridge::ExportedMethod::execute ( void *  obj,
const ParameterStack paramsIn,
ParameterStack paramsOut 
) const
inline

executes the function

References m_proxy_func, and m_ptrWrapper.

Referenced by ug::bridge::lua::ExecuteMethod(), and Java_edu_gcsc_vrl_ug_UG__1invokeMethod().

◆ has_custom_return()

bool ug::bridge::ExportedMethod::has_custom_return ( ) const
inline

returns true if this method handles its own return of values to lua

References m_customReturn.

Referenced by ug::bridge::lua::ExecuteMethod().

Member Data Documentation

◆ m_className

std::string ug::bridge::ExportedMethod::m_className
private

name of class this method belongs to

Referenced by class_name().

◆ m_customReturn

bool ug::bridge::ExportedMethod::m_customReturn
private

◆ m_proxy_func

ProxyFunc ug::bridge::ExportedMethod::m_proxy_func
private

proxy function to call method

Referenced by execute().

◆ m_ptrWrapper

MethodPtrWrapper ug::bridge::ExportedMethod::m_ptrWrapper
private

pointer to function (stored in a wrapper)

Referenced by execute().


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