Class ssq::Table
Class List > ssq > Table
Squirrel table object.
#include <table.hpp>
Inherits the following classes: ssq::Object
Inherited by the following classes: ssq::VM
Public Functions
Type | Name |
---|---|
Table () Creates empty table with null VM . | |
Table (const Object & other) Converts Object toTable . | |
Table (HSQUIRRELVM vm) Creates empty table. | |
Table (const Table & other) Copy constructor. | |
Table (Table && other) Move constructor. | |
Class | addAbstractClass (const char * name) Adds a new abstract class type to this table. |
Class | addClass (const char * name, const std::function< T *(Args...)> & allocator=std::bind(&detail::defaultClassAllocator< T >), bool release=true) Adds a new class type to this table. |
Class | addClass (const char * name, const Class::Ctor< T(Args...)> & constructor, bool release=true) Adds a new class type to this table. |
Class | addClass (const char * name, const F & lambda, bool release=true) Adds a new class type to this table. |
Function | addFunc (const char * name, const std::function< R(Args...)> & func) Adds a new function type to this table. |
Function | addFunc (const char * name, const F & lambda) Adds a new lambda type to this table. |
Table | addTable (const char * name) Adds a new table to this table. |
Class | findClass (const char * name) const Finds a class in this table. |
Function | findFunc (const char * name) const Finds a function in this table. |
T | get (const char * name) |
Table & | operator= (const Table & other) Copy assingment operator. |
Table & | operator= (Table && other) Move assingment operator. |
void | set (const char * name, const T & value) Adds a new key-value pair to this table. |
size_t | size () |
virtual | ~Table () = 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 () |
ssq::Object
Protected Attributes inherited fromType | Name |
---|---|
HSQOBJECT | obj |
HSQUIRRELVM | vm |
bool | weak |
Public Functions Documentation
function Table [1/5]
ssq::Table::Table ()
Note:
This object will be unusable
function Table [2/5]
explicit ssq::Table::Table (
const Object & other
)
Exception:
- TypeException if the Object is not type of a table
function Table [3/5]
explicit ssq::Table::Table (
HSQUIRRELVM vm
)
function Table [4/5]
ssq::Table::Table (
const Table & other
)
function Table [5/5]
ssq::Table::Table (
Table && other
)
function addAbstractClass
template<typename T typename T>
inline Class ssq::Table::addAbstractClass (
const char * name
)
Returns:
Class object references the added class
function addClass [1/3]
template<typename T typename T, typename... Args>
inline Class ssq::Table::addClass (
const char * name,
const std::function< T *(Args...)> & allocator=std::bind(&detail::defaultClassAllocator< T >),
bool release=true
)
Returns:
Class object references the added class
function addClass [2/3]
template<typename T typename T, typename... Args>
inline Class ssq::Table::addClass (
const char * name,
const Class::Ctor < T(Args...)> & constructor,
bool release=true
)
Returns:
Class object references the added class
function addClass [3/3]
template<typename F typename F>
inline Class ssq::Table::addClass (
const char * name,
const F & lambda,
bool release=true
)
Returns:
Class object references the added class
function addFunc [1/2]
template<typename R typename R, typename... Args>
inline Function ssq::Table::addFunc (
const char * name,
const std::function< R(Args...)> & func
)
Returns:
Function object references the added function
function addFunc [2/2]
template<typename F typename F>
inline Function ssq::Table::addFunc (
const char * name,
const F & lambda
)
Returns:
Function object that references the added function
function addTable
Table ssq::Table::addTable (
const char * name
)
function findClass
Class ssq::Table::findClass (
const char * name
) const
Exception:
- NotFoundException if function was not found
- TypeException if the object found is not a function
Returns:
Class object references the found class
function findFunc
Function ssq::Table::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
Returns:
Function object references the found function
function get
template<typename T typename T>
inline T ssq::Table::get (
const char * name
)
function operator=
Table & ssq::Table::operator= (
const Table & other
)
function operator=
Table & ssq::Table::operator= (
Table && other
)
function set
template<typename T typename T>
inline void ssq::Table::set (
const char * name,
const T & value
)
function size
size_t ssq::Table::size ()
function ~Table
virtual ssq::Table::~Table () = default
The documentation for this class was generated from the following file include/simplesquirrel/table.hpp