10#ifndef SQUIRREL_CLASS_HPP
11#define SQUIRREL_CLASS_HPP
19template <
class CL, ScriptType ST>
22 std::string_view classname;
25 DefSQClass(std::string_view _classname) :
40 template <
typename Func>
41 void DefSQMethod(
Squirrel &engine, Func function_proc, std::string_view function_name, std::string_view params = {},
bool suspendable =
false)
54 template <
typename Func>
72 template <
typename Func>
73 void DefSQStaticMethod(
Squirrel &engine, Func function_proc, std::string_view function_name, std::string_view params = {},
bool suspendable =
false)
86 template <
typename Func>
93 template <
typename Var>
94 void DefSQConst(
Squirrel &engine, Var value, std::string_view var_name)
99 void PreRegister(Squirrel &engine)
104 void PreRegister(Squirrel &engine, std::string_view parent_class)
109 template <
typename Func>
110 void AddConstructor(Squirrel &engine, std::string_view params)
112 using namespace SQConvert;
113 engine.
AddMethod(
"constructor", DefSQConstructorCallback<CL, Func>, params);
116 void AddSQAdvancedConstructor(Squirrel &engine)
118 using namespace SQConvert;
119 engine.
AddMethod(
"constructor", DefSQAdvancedConstructorCallback<CL>);
122 void PostRegister(Squirrel &engine)
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.
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.
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!...
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 o...
void AddClassEnd()
Finishes adding a class to the global scope.
void AddConst(std::string_view var_name, SQInteger value)
Adds a const to the stack.
void AddMethod(std::string_view method_name, SQFUNCTION proc, std::string_view params={}, void *userdata=nullptr, int size=0, bool suspendable=false)
Adds a function to the stack.
void AddClassBegin(std::string_view class_name)
Adds a class to the global scope.
The Squirrel convert routines.
SQInteger DefSQAdvancedStaticCallback(HSQUIRRELVM vm)
A general template for all static advanced method callbacks from Squirrel.
SQInteger DefSQAdvancedNonStaticCallback(HSQUIRRELVM vm)
A general template for all non-static advanced method callbacks from Squirrel.
SQInteger DefSQNonStaticCallback(HSQUIRRELVM vm)
A general template for all non-static method callbacks from Squirrel.
SQInteger DefSQStaticCallback(HSQUIRRELVM vm)
A general template for all function/static method callbacks from Squirrel.
Declarations and parts of the implementation of the class for convert code.