The base class for Array that implements almost all of its functionality.
More...
#include <sqratArray.h>
|
| | ArrayBase (HSQUIRRELVM v=DefaultVM::Get()) |
| |
| | ArrayBase (const Object &obj) |
| |
| | ArrayBase (HSQOBJECT o, HSQUIRRELVM v=DefaultVM::Get()) |
| |
| void | Bind (const SQInteger index, Object &obj) |
| |
| ArrayBase & | SquirrelFunc (const SQInteger index, SQFUNCTION func) |
| |
| template<class V > |
| ArrayBase & | SetValue (const SQInteger index, const V &val) |
| |
| template<class V > |
| ArrayBase & | SetInstance (const SQInteger index, V *val) |
| |
| template<class F > |
| ArrayBase & | Func (const SQInteger index, F method) |
| |
| template<typename T > |
| SharedPtr< T > | GetValue (int index) |
| |
| Function | GetFunction (const SQInteger index) |
| |
| template<typename T > |
| void | GetArray (T *array, int size) |
| |
| template<class V > |
| ArrayBase & | Append (const V &val) |
| |
| template<class V > |
| ArrayBase & | Append (V *val) |
| |
| template<class V > |
| ArrayBase & | Insert (const SQInteger destpos, const V &val) |
| |
| template<class V > |
| ArrayBase & | Insert (const SQInteger destpos, V *val) |
| |
| Object | Pop () |
| |
| ArrayBase & | Remove (const SQInteger itemidx) |
| |
| ArrayBase & | Resize (const SQInteger newsize) |
| |
| ArrayBase & | Reverse () |
| |
| SQInteger | Length () const |
| |
| | 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 Array that implements almost all of its functionality.
Default constructor (null)
- Parameters
-
| v | VM that the array will exist in |
| Sqrat::ArrayBase::ArrayBase |
( |
const Object & |
obj | ) |
|
|
inline |
Construct the ArrayBase from an Object that already exists
- Parameters
-
| obj | An Object that should already represent a Squirrel array |
| Sqrat::ArrayBase::ArrayBase |
( |
HSQOBJECT |
o, |
|
|
HSQUIRRELVM |
v = DefaultVM::Get() |
|
) |
| |
|
inline |
Construct the ArrayBase from a HSQOBJECT and HSQUIRRELVM that already exist
- Parameters
-
| o | Squirrel object that should already represent a Squirrel array |
| v | Squirrel VM that contains the Squirrel object given |
template<class V >
| ArrayBase& Sqrat::ArrayBase::Append |
( |
const V & |
val | ) |
|
|
inline |
Appends a value to the end of the Array
- Parameters
-
| val | Value that is being placed in the Array |
- Template Parameters
-
| V | Type of value (usually doesnt need to be defined explicitly) |
- Returns
- The Array itself so the call can be chained
template<class V >
| ArrayBase& Sqrat::ArrayBase::Append |
( |
V * |
val | ) |
|
|
inline |
Appends an instance to the end of the Array (like a reference)
- Parameters
-
| val | Pointer to the instance that is being placed in the Array |
- Template Parameters
-
| V | Type of instance (usually doesnt need to be defined explicitly) |
- Returns
- The Array itself so the call can be chained
| void Sqrat::ArrayBase::Bind |
( |
const SQInteger |
index, |
|
|
Object & |
obj |
|
) |
| |
|
inline |
Binds a Table or Class to the Array (can be used to facilitate namespaces)
- Parameters
-
template<class F >
| ArrayBase& Sqrat::ArrayBase::Func |
( |
const SQInteger |
index, |
|
|
F |
method |
|
) |
| |
|
inline |
Sets an index in the Array to a specific function
- Parameters
-
| index | The index in the array being assigned a value |
| method | Function that is being placed in the Array |
- Template Parameters
-
| F | Type of function (only define this if you need to choose a certain template specialization or overload) |
- Returns
- The Array itself so the call can be chained
template<typename T >
| void Sqrat::ArrayBase::GetArray |
( |
T * |
array, |
|
|
int |
size |
|
) |
| |
|
inline |
Fills a C array with the elements of the Array
- Parameters
-
| array | C array to be filled |
| size | The amount of elements to fill the C array with |
- Template Parameters
-
| T | Type of elements (fails if any elements in Array are not of this type) |
| Function Sqrat::ArrayBase::GetFunction |
( |
const SQInteger |
index | ) |
|
|
inline |
template<typename T >
| SharedPtr<T> Sqrat::ArrayBase::GetValue |
( |
int |
index | ) |
|
|
inline |
Returns the element at a given index
- Parameters
-
| index | Index of the element |
- Template Parameters
-
| T | Type of element (fails if element is not of this type) |
- Returns
- SharedPtr containing the element (or null if failed)
template<class V >
| ArrayBase& Sqrat::ArrayBase::Insert |
( |
const SQInteger |
destpos, |
|
|
const V & |
val |
|
) |
| |
|
inline |
Inserts a value in a position in the Array
- Parameters
-
| destpos | Index to put the new value in |
| val | Value that is being placed in the Array |
- Template Parameters
-
| V | Type of value (usually doesnt need to be defined explicitly) |
- Returns
- The Array itself so the call can be chained
template<class V >
| ArrayBase& Sqrat::ArrayBase::Insert |
( |
const SQInteger |
destpos, |
|
|
V * |
val |
|
) |
| |
|
inline |
Inserts an instance in a position in the Array (like a reference)
- Parameters
-
| destpos | Index to put the new value in |
| val | Pointer to the instance that is being placed in the Array |
- Template Parameters
-
| V | Type of instance (usually doesnt need to be defined explicitly) |
- Returns
- The Array itself so the call can be chained
| SQInteger Sqrat::ArrayBase::Length |
( |
| ) |
const |
|
inline |
Returns the length of the Array
- Returns
- Length in number of elements
| Object Sqrat::ArrayBase::Pop |
( |
| ) |
|
|
inline |
Removes the last element from the Array
- Returns
- Object for the element that was removed (null if failed)
| ArrayBase& Sqrat::ArrayBase::Remove |
( |
const SQInteger |
itemidx | ) |
|
|
inline |
Removes an element at a specific index from the Array
- Parameters
-
| itemidx | Index of the element being removed |
- Returns
- The Array itself so the call can be chained
| ArrayBase& Sqrat::ArrayBase::Resize |
( |
const SQInteger |
newsize | ) |
|
|
inline |
Resizes the Array
- Parameters
-
| newsize | Desired size of the Array in number of elements |
- Returns
- The Array itself so the call can be chained
Reverses the elements of the array in place
- Returns
- The Array itself so the call can be chained
template<class V >
| ArrayBase& Sqrat::ArrayBase::SetInstance |
( |
const SQInteger |
index, |
|
|
V * |
val |
|
) |
| |
|
inline |
Sets an index in the Array to a specific instance (like a reference)
- Parameters
-
| index | The index in the array being assigned a value |
| val | Pointer to the instance that is being placed in the Array |
- Template Parameters
-
| V | Type of instance (usually doesnt need to be defined explicitly) |
- Returns
- The Array itself so the call can be chained
template<class V >
| ArrayBase& Sqrat::ArrayBase::SetValue |
( |
const SQInteger |
index, |
|
|
const V & |
val |
|
) |
| |
|
inline |
Sets an index in the Array to a specific value
- Parameters
-
| index | The index in the array being assigned a value |
| val | Value that is being placed in the Array |
- Template Parameters
-
| V | Type of value (usually doesnt need to be defined explicitly) |
- Returns
- The Array itself so the call can be chained
| ArrayBase& Sqrat::ArrayBase::SquirrelFunc |
( |
const SQInteger |
index, |
|
|
SQFUNCTION |
func |
|
) |
| |
|
inline |
Binds a raw Squirrel closure to the Array
- Parameters
-
| index | The index in the array being assigned a function |
| func | Squirrel function that is being placed in the Array |
- Returns
- The Array 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/sqratArray.h