Google

Main Page   Class Hierarchy   Compound List   File List   Compound Members  

csObject Class Reference

A generic csObject class. More...

#include <csobject.h>

Inheritance diagram for csObject:

iObject iBase csCameraPosition csCollection csColliderWrapper csCurve csCurveTemplate csDataObject csKeyValuePair csLight csMapNode csMaterialWrapper csMeshFactoryWrapper csMeshWrapper csPolygon3D csPolyTxtPlane csPortal csRadElement csRegion csSector csTextureWrapper csThing List of all members.

Public Methods

 csObject (iBase *pParent=NULL)
 Initialize the csObject.

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

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 iObjectGetObjectParent () 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 iObjectGetChild (const char *Name) const
 Return the first child object with the given name.

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

virtual void ObjReleaseOld (iObject *obj)

Public Attributes

 SCF_DECLARE_IBASE

Protected Methods

void InitializeObject ()
 private initialization function.


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.

iObjectParentObject
 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 SCF_QUERY_INTERFACE to get interfaces from the child objects.


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.


Member Function Documentation

void * csObject::GetChild ( int iInterfaceID,
int iVersion,
const char * Name = NULL,
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.

Reimplemented from iObject.

iObjectIterator * csObject::GetIterator ( ) [virtual]
 

Return an iterator for all child objects.

Note that you should not remove child objects while iterating.

Reimplemented from iObject.


The documentation for this class was generated from the following file:
Generated for Crystal Space by doxygen 1.2.5 written by Dimitri van Heesch, ©1997-2000