The base class for Table that implements almost all of its functionality.
More...
#include <sqratTable.h>
|
| | TableBase (HSQUIRRELVM v=DefaultVM::Get()) |
| |
| | TableBase (const Object &obj) |
| |
| | TableBase (HSQOBJECT o, HSQUIRRELVM v=DefaultVM::Get()) |
| |
| void | Bind (const SQChar *name, Object &obj) |
| |
| TableBase & | SquirrelFunc (const SQChar *name, SQFUNCTION func) |
| |
| template<class V > |
| TableBase & | SetValue (const SQChar *name, const V &val) |
| |
| template<class V > |
| TableBase & | SetValue (const SQInteger index, const V &val) |
| |
| template<class V > |
| TableBase & | SetInstance (const SQChar *name, V *val) |
| |
| template<class V > |
| TableBase & | SetInstance (const SQInteger index, V *val) |
| |
| template<class F > |
| TableBase & | Func (const SQChar *name, F method) |
| |
| template<class F > |
| TableBase & | Overload (const SQChar *name, F method) |
| |
| template<typename T > |
| SharedPtr< T > | GetValue (const SQChar *name) |
| |
| template<typename T > |
| SharedPtr< T > | GetValue (int index) |
| |
| Function | GetFunction (const SQChar *name) |
| |
| Function | GetFunction (const SQInteger index) |
| |
| | Object () |
| |
| | Object (const Object &so) |
| |
| | Object (HSQOBJECT o, HSQUIRRELVM v=DefaultVM::Get()) |
| |
| template<class T > |
| | Object (T *instance, HSQUIRRELVM v=DefaultVM::Get()) |
| |
| virtual | ~Object () |
| |
| Object & | operator= (const Object &so) |
| |
| HSQUIRRELVM & | GetVM () |
| |
| HSQUIRRELVM | GetVM () const |
| |
| SQObjectType | GetType () const |
| |
| bool | IsNull () const |
| |
| virtual HSQOBJECT | GetObject () const |
| |
| virtual HSQOBJECT & | GetObject () |
| |
| | operator HSQOBJECT & () |
| |
| void | Release () |
| |
| Object | GetSlot (const SQChar *slot) const |
| |
| Object | GetSlot (SQInteger index) const |
| |
| template<class T > |
| T | Cast () const |
| |
| template<class T > |
| Object | operator[] (T slot) |
| |
| SQInteger | GetSize () const |
| |
| bool | Next (iterator &iter) const |
| |
The base class for Table that implements almost all of its functionality.
Default constructor (null)
- Parameters
-
| v | VM that the table will exist in |
| Sqrat::TableBase::TableBase |
( |
const Object & |
obj | ) |
|
|
inline |
Construct the TableBase from an Object that already exists
- Parameters
-
| obj | An Object that should already represent a Squirrel table |
| Sqrat::TableBase::TableBase |
( |
HSQOBJECT |
o, |
|
|
HSQUIRRELVM |
v = DefaultVM::Get() |
|
) |
| |
|
inline |
Construct the TableBase from a HSQOBJECT and HSQUIRRELVM that already exist
- Parameters
-
| o | Squirrel object that should already represent a Squirrel table |
| v | Squirrel VM that contains the Squirrel object given |
| void Sqrat::TableBase::Bind |
( |
const SQChar * |
name, |
|
|
Object & |
obj |
|
) |
| |
|
inline |
Binds a Table or Class to the Table (can be used to facilitate namespaces)
- Parameters
-
| name | The key in the table being assigned a Table or Class |
| obj | Table or Class that is being placed in the table |
template<class F >
| TableBase& Sqrat::TableBase::Func |
( |
const SQChar * |
name, |
|
|
F |
method |
|
) |
| |
|
inline |
Sets a key in the Table to a specific function
- Parameters
-
| name | The key in the table being assigned a value |
| method | Function that is being placed in the Table |
- Template Parameters
-
| F | Type of function (only define this if you need to choose a certain template specialization or overload) |
- Returns
- The Table itself so the call can be chained
| Function Sqrat::TableBase::GetFunction |
( |
const SQChar * |
name | ) |
|
|
inline |
| Function Sqrat::TableBase::GetFunction |
( |
const SQInteger |
index | ) |
|
|
inline |
template<typename T >
| SharedPtr<T> Sqrat::TableBase::GetValue |
( |
const SQChar * |
name | ) |
|
|
inline |
Returns the value at a given key
- Parameters
-
- Template Parameters
-
| T | Type of value (fails if value is not of this type) |
- Returns
- SharedPtr containing the value (or null if failed)
template<typename T >
| SharedPtr<T> Sqrat::TableBase::GetValue |
( |
int |
index | ) |
|
|
inline |
Returns the value at a given index
- Parameters
-
| index | Index of the element |
- Template Parameters
-
| T | Type of value (fails if value is not of this type) |
- Returns
- SharedPtr containing the value (or null if failed)
template<class F >
| TableBase& Sqrat::TableBase::Overload |
( |
const SQChar * |
name, |
|
|
F |
method |
|
) |
| |
|
inline |
Sets a key in the Table to a specific function and allows the key to be overloaded with functions of a different amount of arguments
- Parameters
-
| name | The key in the table being assigned a value |
| method | Function that is being placed in the Table |
- Template Parameters
-
| F | Type of function (only define this if you need to choose a certain template specialization or overload) |
- Returns
- The Table itself so the call can be chained
template<class V >
| TableBase& Sqrat::TableBase::SetInstance |
( |
const SQChar * |
name, |
|
|
V * |
val |
|
) |
| |
|
inline |
Sets a key in the Table to a specific instance (like a reference)
- Parameters
-
| name | The key in the table being assigned a value |
| val | Pointer to the instance that is being placed in the Table |
- Template Parameters
-
| V | Type of instance (usually doesnt need to be defined explicitly) |
- Returns
- The Table itself so the call can be chained
template<class V >
| TableBase& Sqrat::TableBase::SetInstance |
( |
const SQInteger |
index, |
|
|
V * |
val |
|
) |
| |
|
inline |
Sets an index in the Table to a specific instance (like a reference)
- Parameters
-
| index | The index in the table being assigned a value |
| val | Pointer to the instance that is being placed in the Table |
- Template Parameters
-
| V | Type of instance (usually doesnt need to be defined explicitly) |
- Returns
- The Table itself so the call can be chained
template<class V >
| TableBase& Sqrat::TableBase::SetValue |
( |
const SQChar * |
name, |
|
|
const V & |
val |
|
) |
| |
|
inline |
Sets a key in the Table to a specific value
- Parameters
-
| name | The key in the table being assigned a value |
| val | Value that is being placed in the Table |
- Template Parameters
-
| V | Type of value (usually doesnt need to be defined explicitly) |
- Returns
- The Table itself so the call can be chained
template<class V >
| TableBase& Sqrat::TableBase::SetValue |
( |
const SQInteger |
index, |
|
|
const V & |
val |
|
) |
| |
|
inline |
Sets an index in the Table to a specific value
- Parameters
-
| index | The index in the table being assigned a value |
| val | Value that is being placed in the Table |
- Template Parameters
-
| V | Type of value (usually doesnt need to be defined explicitly) |
- Returns
- The Table itself so the call can be chained
| TableBase& Sqrat::TableBase::SquirrelFunc |
( |
const SQChar * |
name, |
|
|
SQFUNCTION |
func |
|
) |
| |
|
inline |
Binds a raw Squirrel closure to the Table
- Parameters
-
| name | The key in the table being assigned a function |
| func | Squirrel function that is being placed in the Table |
- Returns
- The Table itself so the call can be chained
The documentation for this class was generated from the following file:
- /media/drive2/atai/software_projects/sqrat/sqrat.git/include/sqrat/sqratTable.h