Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

mclass.h

Go to the documentation of this file.
00001 
00025 #ifndef __MAGIC_CLASS_H__
00026 #define __MAGIC_CLASS_H__
00027 
00028 #include "magic/mpararr.h"
00029 #include "magic/mrefarray.h"
00030 #include "magic/mdynamic.h"
00031 
00032 BEGIN_NAMESPACE (MagiC);
00033 
00034 // Externals
00035 template<class K, class V> class Map;
00036 
00037 class ClassLib;
00038 
00040 //                          ___  |                                           //
00041 //                         /   \ |  ___   ____  ____                         //
00042 //                         |     |  ___| (     (                             //
00043 //                         |     | (   |  \__   \__                          //
00044 //                         \___/ |  \__| ____) ____)                         //
00046 
00058 class Class : public Object {
00059 //  decl_dynamic (Class)
00060     String              name;
00061     Array<String>       parents_unfound;
00062     RefArray<Class>     parents;
00063     //Object&           (Object::*mfpGetInstance) ();   // Instanssin luontihuukki
00064     GetClassInstance*   mGetInstance;
00065     friend class ClassLib;
00066   public:
00067 
00069                     Class       () {FORBIDDEN}
00070                     Class       (const char* nam, const char* bases, GetClassInstance*);
00071                     ~Class      ();
00072 
00074     void            addparent   (const char* nam) {;}
00075 
00077     const String&   getname     () const {return name;}
00078 
00080     void            printclassinfo  (FILE* out=stdout) const;
00081 
00083     bool            issameclass (const Object& other) const {
00084         return (Class*)this == (Class*)(&other.getclass());
00085     }
00086 
00088     Object*         getInstance () const {return (Object*) mGetInstance->getInstance();}
00089 };
00090 
00091 
00092 
00094 //                   ___  |                   |     o                        //
00095 //                  /   \ |  ___   ____  ____ |       |                      //
00096 //                  |     |  ___| (     (     |     | |---                   //
00097 //                  |     | (   |  \__   \__  |     | |   )                  //
00098 //                  \___/ |  \__| ____) ____) |____ | |__/                   //
00100 
00105 class ClassLib : public Object {
00106     static Map<String,Class>*   classes;
00107   public:
00108     static  void        printclassinfo  (const String& classname, FILE* out=stdout);
00109     static  Object&     getinstance     (const String& classname);
00110     static  Class*      getclass        (const String& classname);
00111     static  void        insert          (Class& cls);
00112 };
00113 
00114 END_NAMESPACE;
00115 
00116 #endif
00117 

Generated on Thu Feb 10 20:06:41 2005 for LibMagiC by doxygen1.2.18