GameApi 28
Library used by GameApi Builder tool
Loading...
Searching...
No Matches
chaiscript::bootstrap Namespace Reference

Classes and functions useful for bootstrapping of ChaiScript and adding of new types. More...

Namespaces

namespace  standard_library
namespace  operators

Classes

class  Bootstrap

Functions

template<typename T, typename = typename std::enable_if<std::is_array<T>::value>::type>
void array (const std::string &type, Module &m)
template<typename T>
void copy_constructor (const std::string &type, Module &m)
 Adds a copy constructor for the given type to the given Model.
template<typename T>
void opers_comparison (Module &m)
 Add all comparison operators for the templated type. Used during bootstrap, also available to users.
template<typename T>
void basic_constructors (const std::string &type, Module &m)
 Adds default and copy constructors for the given type.
template<typename T>
void construct_pod (const std::string &type, Module &m)
 Adds a constructor for a POD type.
template<typename Input>
auto parse_string (const std::string &i) -> typename std::enable_if< !std::is_same< Input, wchar_t >::value &&!std::is_same< Input, char16_t >::value &&!std::is_same< Input, char32_t >::value, Input >::type
template<typename Input>
auto parse_string (const std::string &) -> typename std::enable_if< std::is_same< Input, wchar_t >::value||std::is_same< Input, char16_t >::value||std::is_same< Input, char32_t >::value, Input >::type
template<typename T>
void bootstrap_pod_type (const std::string &name, Module &m)
template<typename Type>
auto shared_ptr_clone (const std::shared_ptr< Type > &p)
template<typename Type>
std::shared_ptr< typename std::remove_const< Type >::type > shared_ptr_unconst_clone (const std::shared_ptr< typename std::add_const< Type >::type > &p)
 Specific version of shared_ptr_clone just for Proxy_Functions.
template<typename Type>
Boxed_Value ptr_assign (Boxed_Value lhs, const std::shared_ptr< Type > &rhs)

Detailed Description

Classes and functions useful for bootstrapping of ChaiScript and adding of new types.

Function Documentation

◆ array()

template<typename T, typename = typename std::enable_if<std::is_array<T>::value>::type>
void chaiscript::bootstrap::array ( const std::string & type,
Module & m )
Here is the caller graph for this function:

◆ basic_constructors()

template<typename T>
void chaiscript::bootstrap::basic_constructors ( const std::string & type,
Module & m )

Adds default and copy constructors for the given type.

Parameters
[in]typeThe name of the type to add the constructors for.
[in,out]mThe Module to add the basic constructors to
Template Parameters
TType to generate basic constructors for
Returns
The passed in Module
See also
copy_constructor
constructor
Here is the caller graph for this function:

◆ bootstrap_pod_type()

template<typename T>
void chaiscript::bootstrap::bootstrap_pod_type ( const std::string & name,
Module & m )

Add all common functions for a POD type. All operators, and common conversions

Here is the caller graph for this function:

◆ construct_pod()

template<typename T>
void chaiscript::bootstrap::construct_pod ( const std::string & type,
Module & m )

Adds a constructor for a POD type.

Template Parameters
TThe type to add the constructor for
Parameters
[in]typeThe name of the type
[in,out]mThe Module to add the constructor to
Here is the caller graph for this function:

◆ copy_constructor()

template<typename T>
void chaiscript::bootstrap::copy_constructor ( const std::string & type,
Module & m )

Adds a copy constructor for the given type to the given Model.

Parameters
[in]typeThe name of the type. The copy constructor will be named "type".
[in,out]mThe Module to add the copy constructor to
Template Parameters
TThe type to add a copy constructor for
Returns
The passed in Module
Here is the caller graph for this function:

◆ opers_comparison()

template<typename T>
void chaiscript::bootstrap::opers_comparison ( Module & m)

Add all comparison operators for the templated type. Used during bootstrap, also available to users.

Template Parameters
TType to create comparison operators for
Parameters
[in,out]mmodule to add comparison operators to
Returns
the passed in Module.

◆ parse_string() [1/2]

template<typename Input>
auto chaiscript::bootstrap::parse_string ( const std::string & ) ->typenamestd::enable_if< std::is_same< Input, wchar_t >::value||std::is_same< Input, char16_t >::value||std::is_same< Input, char32_t >::value, Input >::type

◆ parse_string() [2/2]

template<typename Input>
auto chaiscript::bootstrap::parse_string ( const std::string & i) ->typenamestd::enable_if<!std::is_same< Input, wchar_t >::value &&!std::is_same< Input, char16_t >::value &&!std::is_same< Input, char32_t >::value, Input >::type

Internal function for converting from a string to a value uses ostream operator >> to perform the conversion

Here is the caller graph for this function:

◆ ptr_assign()

template<typename Type>
Boxed_Value chaiscript::bootstrap::ptr_assign ( Boxed_Value lhs,
const std::shared_ptr< Type > & rhs )

Assignment function for shared_ptr objects, does not perform a copy of the object pointed to, instead maintains the shared_ptr concept. Similar to shared_ptr_clone. Used for Proxy_Function.

Here is the caller graph for this function:

◆ shared_ptr_clone()

template<typename Type>
auto chaiscript::bootstrap::shared_ptr_clone ( const std::shared_ptr< Type > & p)

"clone" function for a shared_ptr type. This is used in the case where you do not want to make a deep copy of an object during cloning but want to instead maintain the shared_ptr. It is needed internally for handling of Proxy_Function object (that is, function variables.

◆ shared_ptr_unconst_clone()

template<typename Type>
std::shared_ptr< typename std::remove_const< Type >::type > chaiscript::bootstrap::shared_ptr_unconst_clone ( const std::shared_ptr< typename std::add_const< Type >::type > & p)

Specific version of shared_ptr_clone just for Proxy_Functions.

Here is the caller graph for this function: