#include <csobject.h>
Inheritance diagram for csObject:
Public Methods | |
csObject (iBase *pParent=NULL) | |
Initialize the csObject. | |
virtual | ~csObject () |
Destroy this object and the associated children. | |
virtual void | SetName (const char *iName) |
Set object name. | |
virtual const char* | GetName () const |
Query object name. | |
virtual CS_ID | GetID () const |
Get the unique ID associated with this object. | |
virtual void | SetObjectParent (iObject *) |
Set the parent csObject. | |
virtual iObject* | GetObjectParent () const |
Returns the parent iObject. | |
virtual void | ObjAdd (iObject *obj) |
Attach a new iObject to the tree. | |
virtual void | ObjRemove (iObject *obj) |
Deletes the given object, removing it from the object tree. | |
virtual void | ObjRemoveAll () |
Deletes all objects, removing them from the object tree. | |
virtual void | ObjAddChildren (iObject *Parent) |
Add all child objects of the given object. | |
virtual void* | GetChild (int iInterfaceID, int iVersion, const char *Name=NULL, bool FirstName=false) const |
Look for a child object that implements the given interface. More... | |
virtual iObject* | GetChild (const char *Name) const |
Return the first child object with the given name. | |
virtual iObjectIterator* | GetIterator () |
Return an iterator for all child objects. More... | |
virtual void | ObjReleaseOld (iObject *obj) |
@@ temporary fix: Remove an object from the tree without doing a DecRef on it. | |
Public Attributes | |
SCF_DECLARE_IBASE | |
Protected Attributes | |
CS_ID | csid |
Each object have a unique ID associated with it. | |
class csObjectContainer* | Children |
The array of child nodes. | |
char* | Name |
Object's name or NULL if unnamed. | |
iObject* | ParentObject |
Parent object. | |
Friends | |
class | csObjectIterator |
Any csObject can have any number of iObject children attached to it. You can use SCF_QUERY_INTERFACE to get interfaces from the child objects.
|
Look for a child object that implements the given interface. You can optionally pass a name to look for. If FirstName is true then the method will stop at the first object with the requested name, even if it did not implement the requested type. Note that the returned object may only be cast to the requested type, no other type, not even iObject!
Note that the returned object will be IncRef'ed. Reimplemented from iObject. |
|
Return an iterator for all child objects. Note that you should not remove child objects while iterating. Reimplemented from iObject. |