|
GameApi 28
Library used by GameApi Builder tool
|
Namespace chaiscript contains every API call that the average user will be concerned with. More...
Namespaces | |
| namespace | detail |
| Classes and functions reserved for internal use. Items in this namespace are not supported. | |
| namespace | exception |
| Classes which may be thrown during error cases when ChaiScript is executing. | |
| namespace | bootstrap |
| Classes and functions useful for bootstrapping of ChaiScript and adding of new types. | |
| namespace | dispatch |
| Classes and functions specific to the runtime dispatch side of ChaiScript. Some items may be of use to the end user. | |
| namespace | parser |
| Classes and functions used during the parsing process. | |
| namespace | eval |
| Classes and functions that are part of the runtime eval system. | |
| namespace | optimizer |
| namespace | utility |
Classes | |
| class | ChaiScript |
| struct | Build_Info |
| class | Std_Lib |
| class | Boxed_Number |
| Represents any numeric type, generically. Used internally for generic operations between POD values. More... | |
| class | Boxed_Value |
| A wrapper for holding any valid C++ type. All types in ChaiScript are Boxed_Value objects. More... | |
| class | Module |
| Holds a collection of ChaiScript settings which can be applied to the ChaiScript runtime. Used to implement loadable module support. More... | |
| class | Type_Conversions |
| class | Type_Conversions_State |
| class | Type_Info |
| Compile time deduced information about a type. More... | |
| struct | Operators |
| struct | Name_Validator |
| struct | File_Position |
| Convenience type for file positions. More... | |
| struct | Parse_Location |
| struct | AST_Node |
| Struct that doubles as both a parser ast_node and an AST node. More... | |
| struct | AST_Node_Trace |
| class | ChaiScript_Basic |
| The main object that the ChaiScript user will use. More... | |
| struct | ChaiScript_Prelude |
| class | json_wrap |
Typedefs | |
| typedef std::shared_ptr< Module > | ModulePtr |
| Convenience typedef for Module objects to be added to the ChaiScript runtime. | |
| typedef std::shared_ptr< detail::Exception_Handler_Base > | Exception_Handler |
| Used in the automatic unboxing of exceptions thrown during script evaluation. | |
| typedef std::unique_ptr< AST_Node > | AST_NodePtr |
| Typedef for pointers to AST_Node objects. Used in building of the AST_Node tree. | |
| typedef std::shared_ptr< dispatch::Proxy_Function_Base > | Proxy_Function |
| Common typedef used for passing of any registered function in ChaiScript. | |
| typedef std::shared_ptr< const dispatch::Proxy_Function_Base > | Const_Proxy_Function |
| Const version of Proxy_Function. Points to a const Proxy_Function. This is how most registered functions are handled internally. | |
| typedef std::shared_ptr< chaiscript::detail::Type_Conversion_Base > | Type_Conversion |
| typedef ModulePtr(* | Create_Module_Func) () |
| Signature of module entry point that all binary loadable modules must implement. | |
| typedef std::unique_ptr< const AST_Node > | AST_NodePtr_Const |
| using | Namespace = dispatch::Dynamic_Object |
| Namespace alias to provide cleaner and more explicit syntax to users. | |
Enumerations | |
| enum class | Options { No_Load_Modules , Load_Modules , No_External_Scripts , External_Scripts } |
| enum class | AST_Node_Type { Id , Fun_Call , Unused_Return_Fun_Call , Arg_List , Equation , Var_Decl , Assign_Decl , Array_Call , Dot_Access , Lambda , Block , Scopeless_Block , Def , While , If , For , Ranged_For , Inline_Array , Inline_Map , Return , File , Prefix , Break , Continue , Map_Pair , Value_Range , Inline_Range , Try , Catch , Finally , Method , Attr_Decl , Logical_And , Logical_Or , Reference , Switch , Case , Default , Noop , Class , Binary , Arg , Global_Decl , Constant , Compiled } |
| Types of AST nodes available to the parser and eval. More... | |
| enum class | Operator_Precidence { Ternary_Cond , Logical_Or , Logical_And , Bitwise_Or , Bitwise_Xor , Bitwise_And , Equality , Comparison , Shift , Addition , Multiplication , Prefix } |
Functions | |
| template<typename B, typename D, typename ... Arg> | |
| std::shared_ptr< B > | make_shared (Arg &&... arg) |
| template<typename B, typename D, typename ... Arg> | |
| std::unique_ptr< B > | make_unique (Arg &&... arg) |
| template<typename T> | |
| auto | parse_num (const char *t_str) -> typename std::enable_if< std::is_integral< T >::value, T >::type |
| template<typename T> | |
| auto | parse_num (const char *t_str) -> typename std::enable_if<!std::is_integral< T >::value, T >::type |
| template<typename T> | |
| T | parse_num (const std::string &t_str) |
| template<typename Type> | |
| decltype(auto) | boxed_cast (const Boxed_Value &bv, const Type_Conversions_State *t_conversions=nullptr) |
| Function for extracting a value stored in a Boxed_Value object. | |
| template<typename T> | |
| Boxed_Value | var (T &&t) |
| Creates a Boxed_Value. If the object passed in is a value type, it is copied. If it is a pointer, std::shared_ptr, or std::reference_type a copy is not made. | |
| template<typename T> | |
| Boxed_Value | const_var (const T &t) |
| Takes an object and returns an immutable Boxed_Value. If the object is a std::reference or pointer type the value is not copied. If it is an object type, it is copied. | |
| Boxed_Value | void_var () |
| Boxed_Value | const_var (bool b) |
| template<typename ... T> | |
| Exception_Handler | exception_specification () |
| creates a chaiscript::Exception_Handler which handles one type of exception unboxing | |
| template<typename T> | |
| Proxy_Function | constructor () |
| Generates a constructor function for use with ChaiScript. | |
| template<typename T> | |
| Proxy_Function | fun (const T &t) |
| Creates a new Proxy_Function object from a free function, member function or data member. | |
| template<typename Ret, typename ... Param> | |
| Proxy_Function | fun (Ret(*func)(Param...)) |
| template<typename Ret, typename Class, typename ... Param> | |
| Proxy_Function | fun (Ret(Class::*t_func)(Param...) const) |
| template<typename T, typename Class> | |
| Proxy_Function | fun (T Class::*m) |
| template<typename T, typename Q> | |
| Proxy_Function | fun (T &&t, const Q &q) |
| Creates a new Proxy_Function object from a free function, member function or data member and binds the first parameter of it. | |
| template<typename Base, typename Derived> | |
| Type_Conversion | base_class (typename std::enable_if< std::is_polymorphic< Base >::value &&std::is_polymorphic< Derived >::value >::type *=nullptr) |
| Used to register a to / parent class relationship with ChaiScript. Necessary if you want automatic conversions up your inheritance hierarchy. | |
| template<typename Base, typename Derived> | |
| Type_Conversion | base_class (typename std::enable_if<!std::is_polymorphic< Base >::value||!std::is_polymorphic< Derived >::value >::type *=nullptr) |
| template<typename Callable> | |
| Type_Conversion | type_conversion (const Type_Info &t_from, const Type_Info &t_to, const Callable &t_func) |
| template<typename From, typename To, typename Callable> | |
| Type_Conversion | type_conversion (const Callable &t_function) |
| template<typename From, typename To> | |
| Type_Conversion | type_conversion () |
| template<typename To> | |
| Type_Conversion | vector_conversion () |
| template<typename To> | |
| Type_Conversion | map_conversion () |
| template<typename T> | |
| constexpr Type_Info | user_type (const T &) |
| Creates a Type_Info object representing the type passed in. | |
| template<typename T> | |
| constexpr Type_Info | user_type () |
| Creates a Type_Info object representing the templated type. | |
Namespace chaiscript contains every API call that the average user will be concerned with.
| typedef std::unique_ptr< AST_Node > chaiscript::AST_NodePtr |
| typedef std::unique_ptr<const AST_Node> chaiscript::AST_NodePtr_Const |
| typedef std::shared_ptr<const dispatch::Proxy_Function_Base> chaiscript::Const_Proxy_Function |
Const version of Proxy_Function. Points to a const Proxy_Function. This is how most registered functions are handled internally.
| typedef ModulePtr(* chaiscript::Create_Module_Func) () |
Signature of module entry point that all binary loadable modules must implement.
| typedef std::shared_ptr<detail::Exception_Handler_Base> chaiscript::Exception_Handler |
Used in the automatic unboxing of exceptions thrown during script evaluation.
Exception specifications allow the user to tell ChaiScript what possible exceptions are expected from the script being executed. Exception_Handler objects are created with the chaiscript::exception_specification() function.
Example:
It is recommended that if catching the generic std::exception& type that you specifically catch the chaiscript::exception::eval_error type, so that there is no confusion.
Similarly, if you are using the ChaiScript::eval form that unboxes the return value, then chaiscript::exception::bad_boxed_cast should be handled as well.
| typedef std::shared_ptr<Module> chaiscript::ModulePtr |
Convenience typedef for Module objects to be added to the ChaiScript runtime.
Namespace alias to provide cleaner and more explicit syntax to users.
| typedef std::shared_ptr<dispatch::Proxy_Function_Base> chaiscript::Proxy_Function |
Common typedef used for passing of any registered function in ChaiScript.
| typedef std::shared_ptr<chaiscript::detail::Type_Conversion_Base> chaiscript::Type_Conversion |
|
strong |
Types of AST nodes available to the parser and eval.
|
strong |
|
strong |
| Type_Conversion chaiscript::base_class | ( | typename std::enable_if< std::is_polymorphic< Base >::value &&std::is_polymorphic< Derived >::value >::type * | = nullptr | ) |
Used to register a to / parent class relationship with ChaiScript. Necessary if you want automatic conversions up your inheritance hierarchy.
Create a new to class registration for applying to a module or to the ChaiScript engine Currently, due to limitations in module loading on Windows, and for the sake of portability, if you have a type that is introduced in a loadable module and is used by multiple modules (through a tertiary dll that is shared between the modules, static linking the new type into both loadable modules would not be portable), you need to register the type relationship in all modules that use the newly added type in a polymorphic way.
Example:

| Type_Conversion chaiscript::base_class | ( | typename std::enable_if<!std::is_polymorphic< Base >::value||!std::is_polymorphic< Derived >::value >::type * | = nullptr | ) |
| decltype(auto) chaiscript::boxed_cast | ( | const Boxed_Value & | bv, |
| const Type_Conversions_State * | t_conversions = nullptr ) |
Function for extracting a value stored in a Boxed_Value object.
| Type | The type to extract from the Boxed_Value |
| [in] | bv | The Boxed_Value to extract a typed value from |
| exception::bad_boxed_cast | If the requested conversion is not possible |
boxed_cast will attempt to make conversions between value, &, *, std::shared_ptr, std::reference_wrapper, and std::function (const and non-const) where possible. boxed_cast is used internally during function dispatch. This means that all of these conversions will be attempted automatically for you during ChaiScript function calls.
Conversions to std::function objects are attempted as well
Example:
std::function conversion example

|
inline |
| Boxed_Value chaiscript::const_var | ( | const T & | t | ) |
Takes an object and returns an immutable Boxed_Value. If the object is a std::reference or pointer type the value is not copied. If it is an object type, it is copied.
| [in] | t | Object to make immutable |
Example:

| Proxy_Function chaiscript::constructor | ( | ) |
Generates a constructor function for use with ChaiScript.
| T | The signature of the constructor to generate. In the form of: ClassType (ParamType1, ParamType2, ...) |
Example:

| Exception_Handler chaiscript::exception_specification | ( | ) |
creates a chaiscript::Exception_Handler which handles one type of exception unboxing

| Proxy_Function chaiscript::fun | ( | const T & | t | ) |
Creates a new Proxy_Function object from a free function, member function or data member.
| [in] | t | Function / member to expose |
Example:
| Proxy_Function chaiscript::fun | ( | Ret(* | func )(Param...) | ) |
| Proxy_Function chaiscript::fun | ( | Ret(Class::* | t_func )(Param...) const | ) |
| Proxy_Function chaiscript::fun | ( | T && | t, |
| const Q & | q ) |
Creates a new Proxy_Function object from a free function, member function or data member and binds the first parameter of it.
Example:
| Proxy_Function chaiscript::fun | ( | T Class::* | m | ) |
|
inline |

|
inline |

| Type_Conversion chaiscript::map_conversion | ( | ) |

| auto chaiscript::parse_num | ( | const char * | t_str | ) | ->typenamestd::enable_if< std::is_integral< T >::value, T >::type |

| auto chaiscript::parse_num | ( | const char * | t_str | ) | ->typenamestd::enable_if<!std::is_integral< T >::value, T >::type |
| Type_Conversion chaiscript::type_conversion | ( | ) |
| Type_Conversion chaiscript::type_conversion | ( | const Callable & | t_function | ) |
| Type_Conversion chaiscript::type_conversion | ( | const Type_Info & | t_from, |
| const Type_Info & | t_to, | ||
| const Callable & | t_func ) |

Creates a Type_Info object representing the templated type.
Example:

Creates a Type_Info object representing the type passed in.
Example:

| Boxed_Value chaiscript::var | ( | T && | t | ) |
Creates a Boxed_Value. If the object passed in is a value type, it is copied. If it is a pointer, std::shared_ptr, or std::reference_type a copy is not made.
| t | The value to box |
Example:

| Type_Conversion chaiscript::vector_conversion | ( | ) |

|
inline |
