Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef __SO3_CREATOR_H__
00029 #define __SO3_CREATOR_H__
00030
00031 #include "../SCOLBasic/SO3Std.h"
00032
00036 #define SO3_CREATOR_CLASS(SO3_CLASS_NAME, OGRE_CLASS_NAME) \
00037 \
00038 \
00039 class SChildOf##SO3_CLASS_NAME##; \
00040 \
00041 class SO3_CLASS_NAME##Base \
00042 { \
00043 public: \
00044 friend SChildOf##SO3_CLASS_NAME##; \
00045 protected: \
00046 private: \
00047 \
00048 public: \
00049 protected: \
00050 \
00053 virtual Ogre::##OGRE_CLASS_NAME##* GetOgre##OGRE_CLASS_NAME##()=0; \
00054 private: \
00055 }; \
00056 \
00057 \
00060 class SChildOf##SO3_CLASS_NAME \
00061 { \
00062 public: \
00063 protected: \
00064 mutable SO3_CLASS_NAME##Base* parent##SO3_CLASS_NAME##; \
00065 private: \
00066 \
00067 public: \
00068 \
00071 SChildOf##SO3_CLASS_NAME##(##SO3_CLASS_NAME##Base* creatorInstance) : parent##SO3_CLASS_NAME##(creatorInstance) \
00072 { \
00073 }; \
00074 \
00075 \
00078 const SO3_CLASS_NAME##Base* GetParent##SO3_CLASS_NAME##() \
00079 { \
00080 return parent##SO3_CLASS_NAME##; \
00081 }; \
00082 protected: \
00083 \
00085 Ogre::##OGRE_CLASS_NAME##* GetOgre##OGRE_CLASS_NAME##() \
00086 { \
00087 assert(parent##SO3_CLASS_NAME##); \
00088 return static_cast <Ogre::##OGRE_CLASS_NAME##*> (parent##SO3_CLASS_NAME##->GetOgre##OGRE_CLASS_NAME##()); \
00089 }; \
00090 private: \
00091 \
00094 SChildOf##SO3_CLASS_NAME##() \
00095 { \
00096 \
00097 }; \
00098 };
00099
00100 #endif