GameApi 28
Library used by GameApi Builder tool
Loading...
Searching...
No Matches
chaiscript::dispatch::Proxy_Function_Base Class Referenceabstract

#include <proxy_functions.hpp>

Inheritance diagram for chaiscript::dispatch::Proxy_Function_Base:
Collaboration diagram for chaiscript::dispatch::Proxy_Function_Base:

Public Member Functions

virtual ~Proxy_Function_Base ()=default
Boxed_Value operator() (const std::vector< Boxed_Value > &params, const chaiscript::Type_Conversions_State &t_conversions) const
const std::vector< Type_Info > & get_param_types () const
virtual bool operator== (const Proxy_Function_Base &) const =0
virtual bool call_match (const std::vector< Boxed_Value > &vals, const Type_Conversions_State &t_conversions) const =0
virtual bool is_attribute_function () const
bool has_arithmetic_param () const
virtual std::vector< std::shared_ptr< const Proxy_Function_Base > > get_contained_functions () const
bool filter (const std::vector< Boxed_Value > &vals, const Type_Conversions_State &t_conversions) const
int get_arity () const
virtual bool compare_first_type (const Boxed_Value &bv, const Type_Conversions_State &t_conversions) const

Static Public Member Functions

static bool compare_type_to_param (const Type_Info &ti, const Boxed_Value &bv, const Type_Conversions_State &t_conversions)

Protected Member Functions

virtual Boxed_Value do_call (const std::vector< Boxed_Value > &params, const Type_Conversions_State &t_conversions) const =0
 Proxy_Function_Base (std::vector< Type_Info > t_types, int t_arity)

Static Protected Member Functions

static bool compare_types (const std::vector< Type_Info > &tis, const std::vector< Boxed_Value > &bvs, const Type_Conversions_State &t_conversions)

Protected Attributes

std::vector< Type_Info > m_types
int m_arity
bool m_has_arithmetic_param

Detailed Description

Pure virtual base class for all Proxy_Function implementations Proxy_Functions are a type erasure of type safe C++ function calls. At runtime parameter types are expected to be tested against passed in types. Dispatch_Engine only knows how to work with Proxy_Function, no other function classes.

Constructor & Destructor Documentation

◆ ~Proxy_Function_Base()

virtual chaiscript::dispatch::Proxy_Function_Base::~Proxy_Function_Base ( )
virtualdefault

◆ Proxy_Function_Base()

chaiscript::dispatch::Proxy_Function_Base::Proxy_Function_Base ( std::vector< Type_Info > t_types,
int t_arity )
inlineprotected
Here is the caller graph for this function:

Member Function Documentation

◆ call_match()

◆ compare_first_type()

virtual bool chaiscript::dispatch::Proxy_Function_Base::compare_first_type ( const Boxed_Value & bv,
const Type_Conversions_State & t_conversions ) const
inlinevirtual

◆ compare_type_to_param()

bool chaiscript::dispatch::Proxy_Function_Base::compare_type_to_param ( const Type_Info & ti,
const Boxed_Value & bv,
const Type_Conversions_State & t_conversions )
inlinestatic
Here is the caller graph for this function:

◆ compare_types()

bool chaiscript::dispatch::Proxy_Function_Base::compare_types ( const std::vector< Type_Info > & tis,
const std::vector< Boxed_Value > & bvs,
const Type_Conversions_State & t_conversions )
inlinestaticprotected
Here is the caller graph for this function:

◆ do_call()

◆ filter()

bool chaiscript::dispatch::Proxy_Function_Base::filter ( const std::vector< Boxed_Value > & vals,
const Type_Conversions_State & t_conversions ) const
inline

Return true if the function is a possible match to the passed in values

◆ get_arity()

int chaiscript::dispatch::Proxy_Function_Base::get_arity ( ) const
inline
Returns
the number of arguments the function takes or -1 if it is variadic
Here is the caller graph for this function:

◆ get_contained_functions()

virtual std::vector< std::shared_ptr< const Proxy_Function_Base > > chaiscript::dispatch::Proxy_Function_Base::get_contained_functions ( ) const
inlinevirtual

◆ get_param_types()

const std::vector< Type_Info > & chaiscript::dispatch::Proxy_Function_Base::get_param_types ( ) const
inline

Returns a vector containing all of the types of the parameters the function returns/takes if the function is variadic or takes no arguments (arity of 0 or -1), the returned value contains exactly 1 Type_Info object: the return type

Returns
the types of all parameters.
Here is the caller graph for this function:

◆ has_arithmetic_param()

bool chaiscript::dispatch::Proxy_Function_Base::has_arithmetic_param ( ) const
inline

◆ is_attribute_function()

virtual bool chaiscript::dispatch::Proxy_Function_Base::is_attribute_function ( ) const
inlinevirtual

◆ operator()()

Boxed_Value chaiscript::dispatch::Proxy_Function_Base::operator() ( const std::vector< Boxed_Value > & params,
const chaiscript::Type_Conversions_State & t_conversions ) const
inline

◆ operator==()

Member Data Documentation

◆ m_arity

int chaiscript::dispatch::Proxy_Function_Base::m_arity
protected

◆ m_has_arithmetic_param

bool chaiscript::dispatch::Proxy_Function_Base::m_has_arithmetic_param
protected

◆ m_types

std::vector<Type_Info> chaiscript::dispatch::Proxy_Function_Base::m_types
protected

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