CrystalSpace

Public API Reference

Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

csObject Class Reference

A generic csObject class. More...

#include <csobject.h>

Inheritance diagram for csObject:

iObject iBase csCameraPosition csCollection csColliderWrapper csDataObject csKeyValuePair csLight csMapNode csMaterialWrapper csMeshFactoryWrapper csMeshWrapper csProcTexture csRegion csSector csSharedVariable csSoundWrapper csTextureWrapper List of all members.

Public Methods

 csObject (iBase *pParent=0)
 Initialize the csObject. More...

 csObject (csObject &o)
 Copy constructor. More...

virtual ~csObject ()
 Destroy this object and the associated children. More...

virtual void SetName (const char *iName)
 Set object name. More...

virtual const char * GetName () const
 Query object name. More...

virtual CS_ID GetID () const
 Get the unique ID associated with this object. More...

virtual void SetObjectParent (iObject *)
 Set the parent csObject. More...

virtual iObjectGetObjectParent () const
 Returns the parent iObject. More...

virtual void ObjAdd (iObject *obj)
 Attach a new iObject to the tree. More...

virtual void ObjRemove (iObject *obj)
 Deletes the given object, removing it from the object tree. More...

virtual void ObjRemoveAll ()
 Deletes all objects, removing them from the object tree. More...

virtual void ObjAddChildren (iObject *Parent)
 Add all child objects of the given object. More...

virtual void * GetChild (int iInterfaceID, int iVersion, const char *Name=0, bool FirstName=false) const
 Look for a child object that implements the given interface. More...

virtual iObjectGetChild (const char *Name) const
 Return the first child object with the given name. More...

virtual csPtr< iObjectIteratorGetIterator ()
 Return an iterator for all child objects. More...


Protected Methods

void InitializeObject ()
 private initialization function. More...


Protected Attributes

CS_ID csid
 Each object has a unique ID associated with it. More...

csObjectContainer * Children
 The array of child nodes. More...

char * Name
 Object's name or 0 if unnamed. More...

iObjectParentObject
 Parent object. More...


Detailed Description

A generic csObject class.

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.

Definition at line 35 of file csobject.h.


Constructor & Destructor Documentation

csObject::csObject iBase   pParent = 0
 

Initialize the csObject.

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 iObject* csObject::GetChild const char *    Name const [virtual]
 

Return the first child object with the given name.

Implements iObject.

virtual void* 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 may only be cast to the requested type, no other type, not even iObject!

Note that the returned object will be IncRef'ed.

Implements iObject.

virtual CS_ID csObject::GetID   const [virtual]
 

Get the unique ID associated with this object.

Implements iObject.

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]
 

Query object name.

Implements iObject.

virtual iObject* csObject::GetObjectParent   const [virtual]
 

Returns the parent iObject.

Implements iObject.

void csObject::InitializeObject   [protected]
 

private initialization function.

virtual void csObject::ObjAdd iObject   obj [virtual]
 

Attach a new iObject to the tree.

Implements iObject.

Referenced by csRegion::Add.

virtual void csObject::ObjAddChildren iObject   Parent [virtual]
 

Add all child objects of the given object.

Implements iObject.

virtual void csObject::ObjRemove iObject   obj [virtual]
 

Deletes the given object, removing it from the object tree.

Implements iObject.

virtual void csObject::ObjRemoveAll   [virtual]
 

Deletes all objects, removing them from the object tree.

Implements iObject.

virtual void csObject::SetName const char *    iName [virtual]
 

Set object name.

Implements iObject.

virtual void csObject::SetObjectParent iObject   [virtual]
 

Set the parent csObject.

Implements iObject.


Member Data Documentation

csObjectContainer* csObject::Children [protected]
 

The array of child nodes.

Definition at line 43 of file csobject.h.

CS_ID csObject::csid [protected]
 

Each object has a unique ID associated with it.

Definition at line 40 of file csobject.h.

char* csObject::Name [protected]
 

Object's name or 0 if unnamed.

Definition at line 46 of file csobject.h.

iObject* csObject::ParentObject [protected]
 

Parent object.

Definition at line 49 of file csobject.h.


The documentation for this class was generated from the following file:
Generated for Crystal Space by doxygen 1.2.14