Class ssq::Class
Class List > ssq > Class
Squirrel class object.
#include <class.hpp>
Inherits the following classes: ssq::Object
Classes
Type | Name |
---|---|
struct | Ctor <class Signature> Constructor helper class. |
struct | Ctor< T(Args...)> <class T, Args> |
Public Functions
Type | Name |
---|---|
Class () Creates an empty invalid class. | |
Class (HSQUIRRELVM vm) Creates a new empty class. | |
Class (const Object & object) Converts Object to class object. | |
Class (const Class & other) Copy constructor. | |
Class (Class && other) Move constructor. | |
void | addConstVar (const std::string & name, V T:😗 ptr, bool isStatic=false) |
Function | addFunc (const char * name, const std::function< Return(Object *, Args...)> & func, bool isStatic=false) Adds a new function type to this class. |
Function | addFunc (const char * name, Return(Object:😗)(Args...) memfunc, bool isStatic=false) Adds a new function type to this class. |
Function | addFunc (const char * name, Return(Object:😗)(Args...) const memfunc, bool isStatic=false) Adds a new function type to this class. |
Function | addFunc (const char * name, const F & lambda, bool isStatic=false) Adds a new function type to this class. |
void | addVar (const std::string & name, V T:😗 ptr, bool isStatic=false) |
Function | findFunc (const char * name) const Finds a function in this class. |
Class & | operator= (const Class & other) Copy assingment operator. |
Class & | operator= (Class && other) Move assingment operator. |
void | swap (Class & other) Swaps two classes. |
virtual | ~Class () = default Destructor. |
ssq::Object
Public Functions inherited fromType | Name |
---|---|
Object () Creates an empty object with null VM . | |
Object (HSQUIRRELVM vm) Creates an empty object. | |
Object (const Object & other) Copy constructor to copy the object reference. | |
Object (Object && other) Move constructor. | |
Object | find (const char * name) const Finds object within this object. |
const HSQUIRRELVM & | getHandle () const Returns the Squirrel virtual machine handle associated with this instance. |
const HSQOBJECT & | getRaw () const Returns raw Squirrel object reference. |
HSQOBJECT & | getRaw () Returns raw Squirrel object reference. |
Type | getType () const Returns the type of the object. |
const char * | getTypeStr () const Returns the type of the object in string format. |
size_t | getTypeTag () const Returns the typetag associated with this object. |
bool | isEmpty () const Checks if the object is empty. |
bool | isNull () const Returns true if the object is nullptr. |
Object & | operator= (const Object & other) Copy assingment operator. |
Object & | operator= (Object && other) Move assingment operator. |
void | reset () Releases the object and resets it to empty. |
void | swap (Object & other) Swaps two objects. |
T | to () const Returns an arbitary value of this object. |
Array | toArray () const Returns the Array value of this object. |
bool | toBool () const Returns the boolean value of this object. |
Class | toClass () const Returns the Class value of this object. |
float | toFloat () const Returns the float value of this object. |
Function | toFunction () const Returns the Function value of this object. |
Instance | toInstance () const Returns the Instance value of this object. |
int32_t | toInt () const Returns the integer value of this object. |
T | toPtrUnsafe () const Unsafe cast this object into any pointer of type T. |
std::string | toString () const Returns the string value of this object. |
Table | toTable () const Returns the Table value of this object. |
virtual | ~Object () |
Protected Attributes
Type | Name |
---|---|
Object | tableGet |
Object | tableSet |
ssq::Object
Protected Attributes inherited fromType | Name |
---|---|
HSQOBJECT | obj |
HSQUIRRELVM | vm |
bool | weak |
Protected Functions
Type | Name |
---|---|
void | bindVar (const std::string & name, V T:😗 ptr, HSQOBJECT & table, SQFUNCTION stub, bool isStatic) |
void | findTable (const char * name, Object & table, SQFUNCTION dlg) const |
Protected Static Functions
Type | Name |
---|---|
SQInteger | dlgGetStub (HSQUIRRELVM vm) |
SQInteger | dlgSetStub (HSQUIRRELVM vm) |
SQInteger | varGetStub (HSQUIRRELVM vm) |
SQInteger | varSetStub (HSQUIRRELVM vm) |
Public Functions Documentation
function Class [1/5]
ssq::Class::Class ()
function Class [2/5]
ssq::Class::Class (
HSQUIRRELVM vm
)
function Class [3/5]
explicit ssq::Class::Class (
const Object & object
)
Exception:
- TypeException if the Object is not type of a class
function Class [4/5]
ssq::Class::Class (
const Class & other
)
function Class [5/5]
ssq::Class::Class (
Class && other
)
function addConstVar
template<typename T typename T, typename V typename V>
inline void ssq::Class::addConstVar (
const std::string & name,
V T::* ptr,
bool isStatic=false
)
function addFunc [1/4]
template<typename Return typename Return, typename Object typename Object, typename... Args>
inline Function ssq::Class::addFunc (
const char * name,
const std::function< Return( Object *, Args...)> & func,
bool isStatic=false
)
Parameters:
- name Name of the function to add
- func std::function that contains "this" pointer to the class type followed by any number of arguments with any type
Exception:
- RuntimeException if VM is invalid
Returns:
Function object references the added function
function addFunc [2/4]
template<typename Return typename Return, typename Object typename Object, typename... Args>
inline Function ssq::Class::addFunc (
const char * name,
Return(Object::*)(Args...) memfunc,
bool isStatic=false
)
Parameters:
- name Name of the function to add
- memfunc Pointer to member function
Exception:
- RuntimeException if VM is invalid
Returns:
Function object references the added function
function addFunc [3/4]
template<typename Return typename Return, typename Object typename Object, typename... Args>
inline Function ssq::Class::addFunc (
const char * name,
Return(Object::*)(Args...) const memfunc,
bool isStatic=false
)
Parameters:
- name Name of the function to add
- memfunc Pointer to constant member function
Exception:
- RuntimeException if VM is invalid
Returns:
Function object references the added function
function addFunc [4/4]
template<typename F typename F>
inline Function ssq::Class::addFunc (
const char * name,
const F & lambda,
bool isStatic=false
)
Parameters:
- name Name of the function to add
- lambda Lambda function that contains "this" pointer to the class type followed by any number of arguments with any type
Exception:
- RuntimeException if VM is invalid
Returns:
Function object references the added function
function addVar
template<typename T typename T, typename V typename V>
inline void ssq::Class::addVar (
const std::string & name,
V T::* ptr,
bool isStatic=false
)
function findFunc
Function ssq::Class::findFunc (
const char * name
) const
Exception:
- RuntimeException if VM is invalid
- NotFoundException if function was not found
- TypeException if the object found is not a function
function operator=
Class & ssq::Class::operator= (
const Class & other
)
function operator=
Class & ssq::Class::operator= (
Class && other
)
function swap
void ssq::Class::swap (
Class & other
)
function ~Class
virtual ssq::Class::~Class () = default
Protected Attributes Documentation
variable tableGet
Object ssq::Class::tableGet;
variable tableSet
Object ssq::Class::tableSet;
Protected Functions Documentation
function bindVar
template<typename T typename T, typename V typename V>
inline void ssq::Class::bindVar (
const std::string & name,
V T::* ptr,
HSQOBJECT & table,
SQFUNCTION stub,
bool isStatic
)
function findTable
void ssq::Class::findTable (
const char * name,
Object & table,
SQFUNCTION dlg
) const
Protected Static Functions Documentation
function dlgGetStub
static SQInteger ssq::Class::dlgGetStub (
HSQUIRRELVM vm
)
function dlgSetStub
static SQInteger ssq::Class::dlgSetStub (
HSQUIRRELVM vm
)
function varGetStub
template<typename T typename T, typename V typename V>
static inline SQInteger ssq::Class::varGetStub (
HSQUIRRELVM vm
)
function varSetStub
template<typename T typename T, typename V typename V>
static inline SQInteger ssq::Class::varSetStub (
HSQUIRRELVM vm
)
The documentation for this class was generated from the following file include/simplesquirrel/class.hpp