csutil/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 "iutil/object.h" 00027 #include "refarr.h" 00028 00029 typedef csRefArray<iObject> csObjectContainer; 00030 00036 class CS_CSUTIL_EXPORT csObject : public iObject 00037 { 00038 protected: 00039 friend class csObjectIterator; 00041 CS_ID csid; 00042 00044 csObjectContainer *Children; 00045 00047 char *Name; 00048 00050 iObject *ParentObject; 00051 00053 void InitializeObject (); 00054 00055 public: 00057 csObject (iBase* pParent = 0); 00058 00064 csObject (csObject &o); 00065 00067 virtual ~csObject (); 00068 00070 virtual void SetName (const char *iName); 00071 00073 virtual const char *GetName () const; 00074 00076 virtual CS_ID GetID () const; 00077 00079 virtual void SetObjectParent (iObject *); 00080 00082 virtual iObject* GetObjectParent () const; 00083 00085 virtual void ObjAdd (iObject *obj); 00086 00088 virtual void ObjRemove (iObject *obj); 00089 00091 virtual void ObjRemoveAll (); 00092 00094 virtual void ObjAddChildren (iObject *Parent); 00095 00106 virtual void* GetChild (int iInterfaceID, int iVersion, 00107 const char *Name = 0, bool FirstName = false) const; 00108 00110 virtual iObject *GetChild (const char *Name) const; 00111 00116 virtual csPtr<iObjectIterator> GetIterator (); 00117 00118 SCF_DECLARE_IBASE; 00119 00120 // @@@ temporary fix 00121 virtual void ObjReleaseOld (iObject *obj); 00122 }; 00123 00124 #endif // __CS_CSOBJECT_H__
Generated for Crystal Space by doxygen 1.2.18