Class ssq::Object
Class List > ssq > Object
Raw Squirrel object.
#include <object.hpp>
Inherited by the following classes: ssq::Array, ssq::Class, ssq::Enum, ssq::Function, ssq::Instance, ssq::Script, ssq::Table
Public Functions
Type | 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 |
---|---|
HSQOBJECT | obj |
HSQUIRRELVM | vm |
bool | weak |
Public Functions Documentation
function Object [1/4]
ssq::Object::Object ()
Note:
This object won't be usable
function Object [2/4]
ssq::Object::Object (
HSQUIRRELVM vm
)
function Object [3/4]
ssq::Object::Object (
const Object & other
)
function Object [4/4]
ssq::Object::Object (
Object && other
)
function find
Object ssq::Object::find (
const char * name
) const
function getHandle
const HSQUIRRELVM & ssq::Object::getHandle () const
function getRaw [1/2]
const HSQOBJECT & ssq::Object::getRaw () const
function getRaw [2/2]
HSQOBJECT & ssq::Object::getRaw ()
function getType
Type ssq::Object::getType () const
function getTypeStr
const char * ssq::Object::getTypeStr () const
function getTypeTag
size_t ssq::Object::getTypeTag () const
Note:
The typetag is equal to hash value of typeid(T)
function isEmpty
bool ssq::Object::isEmpty () const
function isNull
bool ssq::Object::isNull () const
function operator=
Object & ssq::Object::operator= (
const Object & other
)
function operator=
Object & ssq::Object::operator= (
Object && other
)
function reset
void ssq::Object::reset ()
function swap
void ssq::Object::swap (
Object & other
)
function to
template<typename T typename T>
T ssq::Object::to () const
Exception:
- TypeException if this object is not an type of T
function toArray
Array ssq::Object::toArray () const
Exception:
- TypeException if this object is not an array
function toBool
bool ssq::Object::toBool () const
Exception:
- TypeException if this object is not a boolean
function toClass
Class ssq::Object::toClass () const
Exception:
- TypeException if this object is not a class
function toFloat
float ssq::Object::toFloat () const
Exception:
- TypeException if this object is not a float
function toFunction
Function ssq::Object::toFunction () const
Exception:
- TypeException if this object is not a function
function toInstance
Instance ssq::Object::toInstance () const
Exception:
- TypeException if this object is not an instance
function toInt
int32_t ssq::Object::toInt () const
Exception:
- TypeException if this object is not an integer
function toPtrUnsafe
template<typename T typename T>
inline T ssq::Object::toPtrUnsafe () const
Exception:
- TypeException if this object is not an instance
function toString
std::string ssq::Object::toString () const
Exception:
- TypeException if this object is not a sring
function toTable
Table ssq::Object::toTable () const
Exception:
- TypeException if this object is not a table
function ~Object
virtual ssq::Object::~Object ()
Protected Attributes Documentation
variable obj
HSQOBJECT ssq::Object::obj;
variable vm
HSQUIRRELVM ssq::Object::vm;
variable weak
bool ssq::Object::weak;
The documentation for this class was generated from the following file include/simplesquirrel/object.hpp