CrystalSpace

Public API Reference

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

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   Interface##_scfGetID (), Interface##_VERSION))
00039 
00044 #define CS_GET_NAMED_CHILD_OBJECT(object,Interface,name)                \
00045   csPtr<Interface> ((Interface*)(object)->GetChild                      \
00046   (Interface##_scfGetID (), Interface##_VERSION, name))
00047 
00052 #define CS_GET_FIRST_NAMED_CHILD_OBJECT(object,Interface,name)          \
00053   csPtr<Interface> ((Interface*)(object)->GetChild                      \
00054   (Interface##_scfGetID (), Interface##_VERSION, name, true))
00055 
00056 
00057 SCF_VERSION (iObject, 0, 3, 0);
00058 
00062 struct iObject : public iBase
00063 {
00065   virtual void SetName (const char *iName) = 0;
00066 
00068   virtual const char *GetName () const = 0;
00069 
00071   virtual CS_ID GetID () const = 0;
00072 
00077   virtual void SetObjectParent (iObject *obj) = 0;
00078 
00080   virtual iObject* GetObjectParent () const = 0;
00081 
00083   virtual void ObjAdd (iObject *obj) = 0;
00084 
00086   virtual void ObjRemove (iObject *obj) = 0;
00087 
00089   virtual void ObjRemoveAll () = 0;
00090 
00092   virtual void ObjAddChildren (iObject *Parent) = 0;
00093 
00104   virtual void* GetChild (int iInterfaceID, int iVersion,
00105     const char *Name = 0, bool FirstName = false) const = 0;
00106 
00108   virtual iObject *GetChild (const char *Name) const = 0;
00109 
00114   virtual csPtr<iObjectIterator> GetIterator () = 0;
00115 
00116   // @@@ temporary fix
00117   virtual void ObjReleaseOld (iObject *obj) = 0;
00118 };
00119 
00120 
00121 SCF_VERSION (iObjectIterator, 0, 1, 0);
00122 
00130 struct iObjectIterator : public iBase
00131 {
00133   virtual iObject* Next () = 0;
00134 
00136   virtual void Reset () = 0;
00137 
00139   virtual iObject* GetParentObj () const = 0;
00140 
00142   virtual bool HasNext () const = 0;
00143 
00150   virtual iObject* FindName (const char* name) = 0;
00151 };
00152 
00153 
00154 SCF_VERSION (iDataObject, 0, 0, 1);
00155 
00157 struct iDataObject : public iBase
00158 {
00160   virtual iObject *QueryObject () = 0;
00161 
00163   virtual void* GetData () = 0;
00164 };
00167 #endif // __CS_IOBJECT_OBJECT_H__

Generated for Crystal Space by doxygen 1.2.14