CrystalSpace

Public API Reference

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

dataobj.h

00001 /*
00002     Copyright (C) 1998 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_DATAOBJ_H_
00021 #define __CS_DATAOBJ_H_
00022 
00023 #include "csutil/csobject.h"
00024 
00032 class csDataObject : public csObject
00033 {
00034 protected:
00036   void* data;
00037 
00038 public:
00040   csDataObject (void *d) : csObject (), data (d)
00041   { SCF_CONSTRUCT_IBASE (0); SCF_CONSTRUCT_EMBEDDED_IBASE (scfiDataObject); }
00043   void* GetData () const
00044   { return data; }
00048   static void* GetData (iObject* obj)
00049   {
00050     csRef<iDataObject> d (CS_GET_CHILD_OBJECT (obj, iDataObject));
00051     void *res = (d ? d->GetData () : 0);
00052     return res;
00053   }
00054 
00055   SCF_DECLARE_IBASE_EXT (csObject);
00056 
00058   struct DataObject : public iDataObject
00059   {
00060     SCF_DECLARE_EMBEDDED_IBASE (csDataObject);
00061 
00062     virtual iObject* QueryObject ()
00063     { return scfParent; }
00064     virtual void* GetData ()
00065     { return scfParent->GetData (); }
00066   } scfiDataObject;
00067 };
00068 
00069 #endif // __CS_DATAOBJ_H__

Generated for Crystal Space by doxygen 1.2.14