The template to define classes in Squirrel.
More...
#include <squirrel_class.hpp>
|
| | DefSQClass (std::string_view _classname) |
| template<typename Func> |
| void | DefSQMethod (Squirrel &engine, Func function_proc, std::string_view function_name, std::string_view params={}, bool suspendable=false) |
| | This defines a method inside a class for Squirrel with defined params.
|
| template<typename Func> |
| void | DefSQAdvancedMethod (Squirrel &engine, Func function_proc, std::string_view function_name, bool suspendable=false) |
| | This defines a method inside a class for Squirrel, which has access to the 'engine' (experts only!).
|
| template<typename Func> |
| void | DefSQStaticMethod (Squirrel &engine, Func function_proc, std::string_view function_name, std::string_view params={}, bool suspendable=false) |
| | This defines a static method inside a class for Squirrel with defined params.
|
| template<typename Func> |
| void | DefSQAdvancedStaticMethod (Squirrel &engine, Func function_proc, std::string_view function_name, bool suspendable=false) |
| | This defines a static method inside a class for Squirrel, which has access to the 'engine' (experts only!).
|
| template<typename Var> |
| void | DefSQConst (Squirrel &engine, Var value, std::string_view var_name) |
| void | PreRegister (Squirrel &engine) |
| void | PreRegister (Squirrel &engine, std::string_view parent_class) |
| template<typename Func> |
| void | AddConstructor (Squirrel &engine, std::string_view params) |
| void | AddSQAdvancedConstructor (Squirrel &engine) |
| void | PostRegister (Squirrel &engine) |
template<class CL,
ScriptType ST>
class DefSQClass< CL, ST >
The template to define classes in Squirrel.
It takes care of the creation and calling of such classes, to minimize the API layer.
Definition at line 20 of file squirrel_class.hpp.
◆ DefSQClass()
| DefSQClass< CL, ST >::DefSQClass |
( |
std::string_view | _classname | ) |
|
|
inline |
◆ AddConstructor()
◆ AddSQAdvancedConstructor()
◆ DefSQAdvancedMethod()
template<typename Func>
| void DefSQClass< CL, ST >::DefSQAdvancedMethod |
( |
Squirrel & | engine, |
|
|
Func | function_proc, |
|
|
std::string_view | function_name, |
|
|
bool | suspendable = false ) |
|
inline |
◆ DefSQAdvancedStaticMethod()
template<typename Func>
| void DefSQClass< CL, ST >::DefSQAdvancedStaticMethod |
( |
Squirrel & | engine, |
|
|
Func | function_proc, |
|
|
std::string_view | function_name, |
|
|
bool | suspendable = false ) |
|
inline |
◆ DefSQConst()
template<typename Var>
| void DefSQClass< CL, ST >::DefSQConst |
( |
Squirrel & | engine, |
|
|
Var | value, |
|
|
std::string_view | var_name ) |
|
inline |
◆ DefSQMethod()
template<typename Func>
| void DefSQClass< CL, ST >::DefSQMethod |
( |
Squirrel & | engine, |
|
|
Func | function_proc, |
|
|
std::string_view | function_name, |
|
|
std::string_view | params = {}, |
|
|
bool | suspendable = false ) |
|
inline |
This defines a method inside a class for Squirrel with defined params.
- Note
- If you define params, make sure that the first param is always 'x', which is the 'this' inside the function. This is hidden from the rest of the code, but without it calling your function will fail!
- Parameters
-
| engine | The engine to add the function to. |
| function_proc | The actual function to call. |
| function_name | The name of the function. |
| params | String describing the types of the parameters. |
| suspendable | Whether this function can be suspended, or not. |
Definition at line 41 of file squirrel_class.hpp.
◆ DefSQStaticMethod()
template<typename Func>
| void DefSQClass< CL, ST >::DefSQStaticMethod |
( |
Squirrel & | engine, |
|
|
Func | function_proc, |
|
|
std::string_view | function_name, |
|
|
std::string_view | params = {}, |
|
|
bool | suspendable = false ) |
|
inline |
This defines a static method inside a class for Squirrel with defined params.
- Note
- If you define params, make sure that the first param is always 'x', which is the 'this' inside the function. This is hidden from the rest of the code, but without it calling your function will fail!
- Parameters
-
| engine | The engine to add the function to. |
| function_proc | The actual function to call. |
| function_name | The name of the function. |
| params | String describing the types of the parameters. |
| suspendable | Whether this function can be suspended, or not. |
Definition at line 73 of file squirrel_class.hpp.
◆ PostRegister()
◆ PreRegister() [1/2]
◆ PreRegister() [2/2]
| void DefSQClass< CL, ST >::PreRegister |
( |
Squirrel & | engine, |
|
|
std::string_view | parent_class ) |
|
inline |
◆ classname
The documentation for this class was generated from the following file: