CrystalSpace

Public API Reference

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

csobject.h

00001 /*
00002     Copyright (C) 1998-2001 by Jorrit Tyberghein
00003     csObject library (C) 1999 by Ivan Avramovic <ivan@avramovic.com>
00004 
00005     This library is free software; you can redistribute it and/or
00006     modify it under the terms of the GNU Library General Public
00007     License as published by the Free Software Foundation; either
00008     version 2 of the License, or (at your option) any later version.
00009 
00010     This library is distributed in the hope that it will be useful,
00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013     Library General Public License for more details.
00014 
00015     You should have received a copy of the GNU Library General Public
00016     License along with this library; if not, write to the Free
00017     Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00018 */
00019 
00020 #ifndef __CS_CSOBJECT_H__
00021 #define __CS_CSOBJECT_H__
00022 
00023 #include "cstypes.h"
00024 #include "csutil/util.h"
00025 #include "iutil/object.h"
00026 #include "csutil/refarr.h"
00027 
00028 typedef csRefArray<iObject> csObjectContainer;
00029 
00035 class csObject : public iObject
00036 {
00037 protected:
00038   friend class csObjectIterator;
00040   CS_ID csid;
00041 
00043   csObjectContainer *Children;
00044 
00046   char *Name;
00047 
00049   iObject *ParentObject;
00050 
00052   void InitializeObject ();
00053 
00054 public:
00056   csObject (iBase* pParent = NULL);
00057 
00063   csObject (csObject &o);
00064 
00066   virtual ~csObject ();
00067 
00069   virtual void SetName (const char *iName);
00070 
00072   virtual const char *GetName () const;
00073 
00075   virtual CS_ID GetID () const;
00076 
00078   virtual void SetObjectParent (iObject *);
00079 
00081   virtual iObject* GetObjectParent () const;
00082 
00084   virtual void ObjAdd (iObject *obj);
00085 
00087   virtual void ObjRemove (iObject *obj);
00088 
00090   virtual void ObjRemoveAll ();
00091 
00093   virtual void ObjAddChildren (iObject *Parent);
00094 
00105   virtual void* GetChild (int iInterfaceID, int iVersion,
00106     const char *Name = NULL, bool FirstName = false) const;
00107 
00109   virtual iObject *GetChild (const char *Name) const;
00110 
00115   virtual csPtr<iObjectIterator> GetIterator ();
00116 
00117   SCF_DECLARE_IBASE;
00118 
00119   // @@@ temporary fix
00120   virtual void ObjReleaseOld (iObject *obj);
00121 };
00122 
00123 #endif // __CS_CSOBJECT_H__

Generated for Crystal Space by doxygen 1.2.14