Classes and functions useful for bootstrapping of ChaiScript and adding of new types.
More...
|
| 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) |
Classes and functions useful for bootstrapping of ChaiScript and adding of new types.
◆ 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 ) |
◆ basic_constructors()
| void chaiscript::bootstrap::basic_constructors |
( |
const std::string & | type, |
|
|
Module & | m ) |
Adds default and copy constructors for the given type.
- Parameters
-
| [in] | type | The name of the type to add the constructors for. |
| [in,out] | m | The Module to add the basic constructors to |
- Template Parameters
-
| T | Type to generate basic constructors for |
- Returns
- The passed in Module
- See also
- copy_constructor
-
constructor
◆ bootstrap_pod_type()
| 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
◆ construct_pod()
| void chaiscript::bootstrap::construct_pod |
( |
const std::string & | type, |
|
|
Module & | m ) |
Adds a constructor for a POD type.
- Template Parameters
-
| T | The type to add the constructor for |
- Parameters
-
| [in] | type | The name of the type |
| [in,out] | m | The Module to add the constructor to |
◆ copy_constructor()
| 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] | type | The name of the type. The copy constructor will be named "type". |
| [in,out] | m | The Module to add the copy constructor to |
- Template Parameters
-
| T | The type to add a copy constructor for |
- Returns
- The passed in Module
◆ opers_comparison()
| void chaiscript::bootstrap::opers_comparison |
( |
Module & | m | ) |
|
Add all comparison operators for the templated type. Used during bootstrap, also available to users.
- Template Parameters
-
| T | Type to create comparison operators for |
- Parameters
-
| [in,out] | m | module 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
◆ ptr_assign()
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.
◆ shared_ptr_clone()
| 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()
| 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.