![]() |
Public API Reference |
![]() |
This provides the interface to an object in an object-oriented scripting language. More...
#include <ivaria/script.h>
Public Member Functions | |
virtual csPtr< iScriptValue > | Call (const char *name, const csRefArray< iScriptValue > &args=csRefArray< iScriptValue >())=0 |
Calls a method in the object. | |
virtual csPtr< iScriptValue > | Get (const char *name)=0 |
Gets the value of a property in the script object. | |
virtual const csRef< iString > | GetClass () const =0 |
Returns the name of this object's class. | |
virtual void * | GetPointer ()=0 |
If the object is from the cspace module, this will return its pointer. | |
virtual iScript * | GetScript ()=0 |
Returns a reference to the iScript to which this object belongs. | |
virtual bool | IsA (const char *) const =0 |
Returns a boolean specifying whether or not the object "is a" or is derived from the named class. | |
virtual bool | IsType (const char *) const =0 |
Deprecated version of IsA(). | |
virtual bool | Set (const char *name, iScriptValue *value)=0 |
Sets the value of a property in the script object. | |
virtual bool | SetPointer (void *)=0 |
If the object is from the cspace module, this will allow you to change the reference to point to another object of the same class. |
This provides the interface to an object in an object-oriented scripting language.
Main ways to get pointers to this interface:
virtual csPtr<iScriptValue> iScriptObject::Call | ( | const char * | name, |
const csRefArray< iScriptValue > & | args = csRefArray< iScriptValue >() |
||
) | [pure virtual] |
Calls a method in the object.
name | The name of the method to call. |
args | An optional array of arguments to pass to the method. |
Implemented in csScriptObjectCommon.
virtual csPtr<iScriptValue> iScriptObject::Get | ( | const char * | name | ) | [pure virtual] |
Gets the value of a property in the script object.
name | The name of the property. |
Implemented in csScriptObjectCommon.
virtual const csRef<iString> iScriptObject::GetClass | ( | ) | const [pure virtual] |
Returns the name of this object's class.
If the object is from the cspace module, the name will be returned without the cspace namespace qualifier.
virtual void* iScriptObject::GetPointer | ( | ) | [pure virtual] |
If the object is from the cspace module, this will return its pointer.
If it is not from the cspace module, the behaviour will be undefined.
Some implementations may wish to extend the behaviour of this method to return pointers to other types of object, but that would be specific to the implementation.
virtual iScript* iScriptObject::GetScript | ( | ) | [pure virtual] |
Returns a reference to the iScript to which this object belongs.
virtual bool iScriptObject::IsA | ( | const char * | ) | const [pure virtual] |
Returns a boolean specifying whether or not the object "is a" or is derived from the named class.
This may or may not be a class from the cspace module. Also, such classes may be specified with or without the cspace namespace qualifier.
virtual bool iScriptObject::IsType | ( | const char * | ) | const [pure virtual] |
Deprecated version of IsA().
Implemented in csScriptObjectCommon.
virtual bool iScriptObject::Set | ( | const char * | name, |
iScriptValue * | value | ||
) | [pure virtual] |
Sets the value of a property in the script object.
name | The name of the property. |
value | The value that the property will be set to. |
Implemented in csScriptObjectCommon.
virtual bool iScriptObject::SetPointer | ( | void * | ) | [pure virtual] |
If the object is from the cspace module, this will allow you to change the reference to point to another object of the same class.
NOTE: This is not guaranteed to work, is deprecated, and will be removed!
Implemented in csScriptObjectCommon.