ChaiScript
Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
chaiscript::dispatch::Proxy_Function_Base Class Referenceabstract

Pure virtual base class for all Proxy_Function implementations Proxy_Functions are a type erasure of type safe C++ function calls. More...

#include <proxy_functions.hpp>

Inheritance diagram for chaiscript::dispatch::Proxy_Function_Base:
chaiscript::detail::Dispatch_Function chaiscript::dispatch::Attribute_Access< T, Class > chaiscript::dispatch::Bound_Function chaiscript::dispatch::detail::Dynamic_Object_Constructor chaiscript::dispatch::detail::Dynamic_Object_Function chaiscript::dispatch::Dynamic_Proxy_Function chaiscript::dispatch::Proxy_Function_Impl_Base chaiscript::dispatch::Dynamic_Proxy_Function_Impl< Callable > chaiscript::dispatch::Assignable_Proxy_Function chaiscript::dispatch::Proxy_Function_Callable_Impl< Func, Callable > chaiscript::dispatch::Assignable_Proxy_Function_Impl< Func >

Public Member Functions

Boxed_Value operator() (const Function_Params &params, const chaiscript::Type_Conversions_State &t_conversions) const
 
const std::vector< Type_Info > & get_param_types () const noexcept
 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. More...
 
virtual bool operator== (const Proxy_Function_Base &) const noexcept=0
 
virtual bool call_match (const Function_Params &vals, const Type_Conversions_State &t_conversions) const =0
 
virtual bool is_attribute_function () const noexcept
 
bool has_arithmetic_param () const noexcept
 
virtual std::vector< std::shared_ptr< const Proxy_Function_Base > > get_contained_functions () const
 
bool filter (const Function_Params &vals, const Type_Conversions_State &t_conversions) const noexcept
 Return true if the function is a possible match to the passed in values.
 
int get_arity () const noexcept
 
virtual bool compare_first_type (const Boxed_Value &bv, const Type_Conversions_State &t_conversions) const noexcept
 

Static Public Member Functions

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

Protected Member Functions

virtual Boxed_Value do_call (const Function_Params &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 Function_Params &bvs, const Type_Conversions_State &t_conversions) noexcept
 

Protected Attributes

std::vector< Type_Infom_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.

Member Function Documentation

§ compare_first_type()

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

TODO is m_types guaranteed to be at least 2??

§ get_arity()

int chaiscript::dispatch::Proxy_Function_Base::get_arity ( ) const
inlinenoexcept
Returns
the number of arguments the function takes or -1 if it is variadic

§ get_param_types()

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

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.

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