//=========================================================================================== /// /// @brief Replacement templates for the console object define/implement macros /// /// @author James Steele /// /// @date 6/8/2008 /// /// @note 1) These templates use typeid. On Microsoft ( for PC at any rate) you can turn off /// rtti support and it will still compile. Not sure how this stands for other /// compilers, such as the 360. Anything GCC based will complain and throw /// an error if you turn RTTI off though. /// /// //============================================================================================ #ifndef D_CONSOLECLASSES_H #define D_CONSOLECLASSES_H #include #include "console/console.h" #include "console/consoleobject.h" /// The base console object template. template class IConsoleObject : public P { public: typedef C Class; typedef P Parent; typedef ConcreteClassRep TConcreateClassRep; /// The type for this class. static TConcreateClassRep dynClassRep; /// Static call for getting the PARENT class type static AbstractClassRep* getParentStaticClassRep() { return Parent::getStaticClassRep(); } /// Static call for getting the class type static AbstractClassRep* getStaticClassRep() { return &dynClassRep; } /// Instance call for getting the class type virtual AbstractClassRep* getClassRep() const { return &Class::dynClassRep; } /// Nw property registration static void initPersistFields(void) { // Empty! } /// Old property registration static void consoleInit(void) { // Empty } }; /// Template for objects that transmit data over the network template class INetObject : public IConsoleObject { }; /// Template for data blocks. template class IDataBlock : public IConsoleObject { }; /// @note - The +6 is a bit hacky. Sorry about that, but it's to get rid of the "class " text at the start of the /// name string. template typename ConcreteClassRep IConObjectBase::dynClassRep(typeid(C).name()+6, F0, F1, F2, P::getParentStaticClassRep()); #endif