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) :
35 template <
typename Func>
36 void DefSQMethod(
Squirrel &engine, Func function_proc, std::string_view function_name, std::string_view params = {},
bool suspendable =
false)
45 template <
typename Func>
58 template <
typename Func>
59 void DefSQStaticMethod(
Squirrel &engine, Func function_proc, std::string_view function_name, std::string_view params = {},
bool suspendable =
false)
68 template <
typename Func>
75 template <
typename Var>
76 void DefSQConst(
Squirrel &engine, Var value, std::string_view var_name)
81 void PreRegister(Squirrel &engine)
86 void PreRegister(Squirrel &engine, std::string_view parent_class)
91 template <
typename Func>
92 void AddConstructor(Squirrel &engine, std::string_view params)
94 using namespace SQConvert;
95 engine.
AddMethod(
"constructor", DefSQConstructorCallback<CL, Func>, params);
98 void AddSQAdvancedConstructor(Squirrel &engine)
100 using namespace SQConvert;
101 engine.
AddMethod(
"constructor", DefSQAdvancedConstructorCallback<CL>);
104 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.