csObject Class Reference
A generic csObject class. More...
#include <csutil/csobject.h>
Inheritance diagram for csObject:
Public Member Functions | |
virtual void | AddNameChangeListener (iObjectNameChangeListener *listener) |
Add a name change listener. | |
csObject (csObject &o) | |
Copy constructor. | |
csObject (iBase *pParent=0) | |
Initialize the csObject. | |
virtual iObject * | GetChild (const char *Name) const |
Return the first child object with the given name. | |
virtual iObject * | GetChild (int iInterfaceID, int iVersion, const char *Name=0, bool FirstName=false) const |
Look for a child object that implements the given interface. | |
virtual uint | GetID () const |
Get the unique ID associated with this object. | |
virtual csPtr< iObjectIterator > | GetIterator () |
Return an iterator for all child objects. | |
virtual const char * | GetName () const |
Query object name. | |
virtual iObject * | GetObjectParent () const |
Returns the parent iObject. | |
virtual void | ObjAdd (iObject *obj) |
Attach a new iObject to the tree. | |
virtual void | ObjAddChildren (iObject *Parent) |
Add all child objects of the given object. | |
virtual void | ObjReleaseOld (iObject *obj) |
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 | RemoveNameChangeListener (iObjectNameChangeListener *listener) |
Remove a name change listener. | |
virtual void | SetName (const char *iName) |
Set object name. | |
virtual void | SetObjectParent (iObject *) |
Set the parent csObject. | |
virtual | ~csObject () |
Destroy this object and the associated children. | |
Protected Member Functions | |
void | FireNameChangeListeners (const char *oldname, const char *newname) |
Fire name change listeners. | |
void | InitializeObject () |
Private initialization function. | |
Protected Attributes | |
csObjectContainer * | Children |
The array of child nodes. | |
uint | csid |
Each object has a unique ID associated with it. | |
csRefArray< iObjectNameChangeListener > | listeners |
Name change listeners. | |
char * | Name |
Object's name or 0 if unnamed. | |
iObject * | ParentObject |
Parent object. | |
Friends | |
class | csObjectIterator |
Detailed Description
A generic csObject class.Any csObject can have any number of iObject children attached to it. You can use scfQueryInterface to get interfaces from the child objects.
Definition at line 42 of file csobject.h.
Constructor & Destructor Documentation
csObject::csObject | ( | csObject & | o | ) |
Copy constructor.
The copied object contains all children of the original object, but has a new ID and is not automatically added to the original object's parent.
virtual csObject::~csObject | ( | ) | [virtual] |
Destroy this object and the associated children.
Member Function Documentation
virtual void csObject::AddNameChangeListener | ( | iObjectNameChangeListener * | listener | ) | [virtual] |
void csObject::FireNameChangeListeners | ( | const char * | oldname, | |
const char * | newname | |||
) | [protected] |
Fire name change listeners.
virtual iObject* csObject::GetChild | ( | const char * | Name | ) | const [virtual] |
virtual iObject* csObject::GetChild | ( | int | iInterfaceID, | |
int | iVersion, | |||
const char * | Name = 0 , |
|||
bool | FirstName = false | |||
) | const [virtual] |
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 must still be queried for the requested type.
Note that the returned object will be IncRef'ed.
Implements iObject.
virtual uint csObject::GetID | ( | ) | const [virtual] |
virtual csPtr<iObjectIterator> csObject::GetIterator | ( | ) | [virtual] |
Return an iterator for all child objects.
Note that you should not remove child objects while iterating.
Implements iObject.
virtual const char* csObject::GetName | ( | ) | const [virtual] |
virtual iObject* csObject::GetObjectParent | ( | ) | const [virtual] |
void csObject::InitializeObject | ( | ) | [protected] |
Private initialization function.
virtual void csObject::ObjAdd | ( | iObject * | obj | ) | [virtual] |
virtual void csObject::ObjAddChildren | ( | iObject * | Parent | ) | [virtual] |
virtual void csObject::ObjReleaseOld | ( | iObject * | obj | ) | [virtual] |
virtual void csObject::ObjRemove | ( | iObject * | obj | ) | [virtual] |
virtual void csObject::ObjRemoveAll | ( | ) | [virtual] |
virtual void csObject::RemoveNameChangeListener | ( | iObjectNameChangeListener * | listener | ) | [virtual] |
virtual void csObject::SetName | ( | const char * | iName | ) | [virtual] |
virtual void csObject::SetObjectParent | ( | iObject * | ) | [virtual] |
Member Data Documentation
csObjectContainer* csObject::Children [protected] |
uint csObject::csid [protected] |
csRefArray<iObjectNameChangeListener> csObject::listeners [protected] |
char* csObject::Name [protected] |
iObject* csObject::ParentObject [protected] |
The documentation for this class was generated from the following file:
- csutil/csobject.h
Generated for Crystal Space by doxygen 1.4.7