CrystalSpace

Public API Reference

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

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 "csextern.h"
00024 #include "cstypes.h"
00025 #include "util.h"
00026 #include "csutil/leakguard.h"
00027 #include "iutil/object.h"
00028 #include "refarr.h"
00029 
00030 typedef csRefArray<iObject> csObjectContainer;
00031 
00037 class CS_CSUTIL_EXPORT csObject : public iObject
00038 {
00039 protected:
00040   friend class csObjectIterator;
00042   uint csid;
00043 
00045   csObjectContainer *Children;
00046 
00048   char *Name;
00049 
00051   iObject *ParentObject;
00052 
00054   void InitializeObject ();
00055 
00056 public:
00057   CS_LEAKGUARD_DECLARE (csObject);
00058 
00060   csObject (iBase* pParent = 0);
00061 
00067   csObject (csObject &o);
00068 
00070   virtual ~csObject ();
00071 
00073   virtual void SetName (const char *iName);
00074 
00076   virtual const char *GetName () const;
00077 
00079   virtual uint GetID () const;
00080 
00082   virtual void SetObjectParent (iObject *);
00083 
00085   virtual iObject* GetObjectParent () const;
00086 
00088   virtual void ObjAdd (iObject *obj);
00089 
00091   virtual void ObjRemove (iObject *obj);
00092 
00094   virtual void ObjRemoveAll ();
00095 
00097   virtual void ObjAddChildren (iObject *Parent);
00098 
00109   virtual void* GetChild (int iInterfaceID, int iVersion,
00110     const char *Name = 0, bool FirstName = false) const;
00111 
00113   virtual iObject *GetChild (const char *Name) const;
00114 
00119   virtual csPtr<iObjectIterator> GetIterator ();
00120 
00121   SCF_DECLARE_IBASE;
00122 
00123   // @@@ temporary fix
00124   virtual void ObjReleaseOld (iObject *obj);
00125 };
00126 
00127 #endif // __CS_CSOBJECT_H__

Generated for Crystal Space by doxygen 1.3.9.1