iutil/object.h
Go to the documentation of this file.00001 /* 00002 Copyright (C) 2000 by Jorrit Tyberghein 00003 00004 This library is free software; you can redistribute it and/or 00005 modify it under the terms of the GNU Library General Public 00006 License as published by the Free Software Foundation; either 00007 version 2 of the License, or (at your option) any later version. 00008 00009 This library is distributed in the hope that it will be useful, 00010 but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 Library General Public License for more details. 00013 00014 You should have received a copy of the GNU Library General Public 00015 License along with this library; if not, write to the Free 00016 Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00017 */ 00018 00019 #ifndef __CS_IOBJECT_OBJECT_H__ 00020 #define __CS_IOBJECT_OBJECT_H__ 00021 00026 #include "csutil/scf.h" 00027 #include "csutil/ref.h" 00028 00029 struct iObjectIterator; 00030 00036 #define CS_GET_CHILD_OBJECT(object,Interface) \ 00037 csPtr<Interface> ((Interface*)(object)->GetChild( \ 00038 scfInterface<Interface>::GetID(), scfInterface<Interface>::GetVersion())) 00039 00044 #define CS_GET_NAMED_CHILD_OBJECT(object,Interface,name) \ 00045 csPtr<Interface> ((Interface*)(object)->GetChild( \ 00046 scfInterface<Interface>::GetID(), scfInterface<Interface>::GetVersion(), \ 00047 name)) 00048 00053 #define CS_GET_FIRST_NAMED_CHILD_OBJECT(object,Interface,name) \ 00054 csPtr<Interface> ((Interface*)(object)->GetChild( \ 00055 scfInterface<Interface>::GetID(), scfInterface<Interface>::GetVersion(), \ 00056 name, true)) 00057 00058 00059 SCF_VERSION (iObject, 0, 3, 0); 00060 00064 struct iObject : public iBase 00065 { 00067 virtual void SetName (const char *iName) = 0; 00068 00070 virtual const char *GetName () const = 0; 00071 00073 virtual CS_ID GetID () const = 0; 00074 00079 virtual void SetObjectParent (iObject *obj) = 0; 00080 00082 virtual iObject* GetObjectParent () const = 0; 00083 00085 virtual void ObjAdd (iObject *obj) = 0; 00086 00088 virtual void ObjRemove (iObject *obj) = 0; 00089 00091 virtual void ObjRemoveAll () = 0; 00092 00094 virtual void ObjAddChildren (iObject *Parent) = 0; 00095 00106 virtual void* GetChild (int iInterfaceID, int iVersion, 00107 const char *Name = 0, bool FirstName = false) const = 0; 00108 00110 virtual iObject *GetChild (const char *Name) const = 0; 00111 00116 virtual csPtr<iObjectIterator> GetIterator () = 0; 00117 00118 // @@@ temporary fix 00119 virtual void ObjReleaseOld (iObject *obj) = 0; 00120 }; 00121 00122 00123 SCF_VERSION (iObjectIterator, 0, 1, 0); 00124 00132 struct iObjectIterator : public iBase 00133 { 00135 virtual iObject* Next () = 0; 00136 00138 virtual void Reset () = 0; 00139 00141 virtual iObject* GetParentObj () const = 0; 00142 00144 virtual bool HasNext () const = 0; 00145 00152 virtual iObject* FindName (const char* name) = 0; 00153 }; 00154 00155 00156 SCF_VERSION (iDataObject, 0, 0, 1); 00157 00159 struct iDataObject : public iBase 00160 { 00162 virtual iObject *QueryObject () = 0; 00163 00165 virtual void* GetData () = 0; 00166 }; 00169 #endif // __CS_IOBJECT_OBJECT_H__
Generated for Crystal Space by doxygen 1.2.18