Skip to content

class Object

Properties

PropertyDescription
NameThe name of the Object object.

Methods

MethodDescription
AddObserverAdds a user-defined observer object to the interface, that will receive events from the interface.
GetClassGet the name of the Object class.
IsAReturns true if Object is a or is a descendant of the class named as the type parameter.
IsNullReturns true if the Object object is invalid.
IsSameObjectAsReturns true if the Object object is valid.
NonNullReturns true if the Object object is valid.
PrintInfoPrints the content/info of the Object object to the log.
RemoveObserverRemoves a previously added observer object.

Static methods

MethodDescription
IsClassAReturns true if the class is a or is a descendant of the class named as the type parameter.
SafeCastSafeCast makes sure the input object is of a class that can be cast into spObject, and if this is the case, returns the object cast into spObject.

Properties details

Name

The name of the Object object.

Syntax

cpp
// Setter
void SetName( const char * name ) const;

// Getter
spString GetName() const;

SetName parameters

TypeNameMinMaxDescription
const char *nameNew name of the object.

GetName return value

Type: spString

Methods details

AddObserver

Adds a user-defined observer object to the interface, that will receive events from the interface.

Syntax

cpp
rid AddObserver( const spObserver & observer ) const;

Parameters

TypeNameMinMaxDescription
ObserverobserverObserver is the object that will receive events.

Return value

Type: rid

GetClass

Get the name of the Object class.

Syntax

cpp
spString GetClass() const;

Parameters

GetClass takes no parameters.

Return value

Type: spString

IsA

Returns true if Object is a or is a descendant of the class named as the type parameter.

Syntax

cpp
bool IsA( const char * type ) const;

Parameters

TypeNameMinMaxDescription
const char *typeName of the class to check if Object is, or is a descendant of.

Return value

Type: bool

IsNull

Returns true if the Object object is invalid.

Syntax

cpp
bool IsNull() const;

Parameters

IsNull takes no parameters.

Return value

Type: bool

IsSameObjectAs

Returns true if the Object object is valid.

Syntax

cpp
bool IsSameObjectAs( const spObject & object ) const;

Parameters

TypeNameMinMaxDescription
ObjectobjectObject to compare with.

Return value

Type: bool

NonNull

Returns true if the Object object is valid.

Syntax

cpp
bool NonNull() const;

Parameters

NonNull takes no parameters.

Return value

Type: bool

PrintInfo

Prints the content/info of the Object object to the log.

Syntax

cpp
void PrintInfo() const;

Parameters

PrintInfo takes no parameters.

RemoveObserver

Removes a previously added observer object.

Syntax

cpp
void RemoveObserver( rid observerId ) const;

Parameters

TypeNameMinMaxDescription
ridobserverIdObserverId is the id returned by AddObserver when the observer was added.

Static methods details

IsClassA

Returns true if the class is a or is a descendant of the class named as the type parameter.

Syntax

cpp
static bool IsClassA( const char * type ) const;

Parameters

TypeNameMinMaxDescription
const char *typeName of the class to check if the class is, or is a descendant of.

Return value

Type: bool

SafeCast

SafeCast makes sure the input object is of a class that can be cast into spObject, and if this is the case, returns the object cast into spObject.

Syntax

cpp
static spObject SafeCast( const spObject & object ) const;

Parameters

TypeNameMinMaxDescription
ObjectobjectObject to cast.

Return value

Type: Object