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
00029
00030 #ifndef CLASS_LOADER__REGISTER_MACRO_HPP_
00031 #define CLASS_LOADER__REGISTER_MACRO_HPP_
00032
00033 #include <string>
00034
00035 #include "console_bridge/console.h"
00036
00037 #include "class_loader/class_loader_core.hpp"
00038 #include "class_loader/console_bridge_compatibility.hpp"
00039
00040 #define CLASS_LOADER_REGISTER_CLASS_INTERNAL_WITH_MESSAGE(Derived, Base, UniqueID, Message) \
00041 namespace \
00042 { \
00043 struct ProxyExec ## UniqueID \
00044 { \
00045 typedef Derived _derived; \
00046 typedef Base _base; \
00047 ProxyExec ## UniqueID() \
00048 { \
00049 if (!std::string(Message).empty()) { \
00050 CONSOLE_BRIDGE_logInform("%s", Message);} \
00051 class_loader::class_loader_private::registerPlugin<_derived, _base>(#Derived, #Base); \
00052 } \
00053 }; \
00054 static ProxyExec ## UniqueID g_register_plugin_ ## UniqueID; \
00055 } // namespace
00056
00057 #define CLASS_LOADER_REGISTER_CLASS_INTERNAL_HOP1_WITH_MESSAGE(Derived, Base, UniqueID, Message) \
00058 CLASS_LOADER_REGISTER_CLASS_INTERNAL_WITH_MESSAGE(Derived, Base, UniqueID, Message)
00059
00064 #define CLASS_LOADER_REGISTER_CLASS_WITH_MESSAGE(Derived, Base, Message) \
00065 CLASS_LOADER_REGISTER_CLASS_INTERNAL_HOP1_WITH_MESSAGE(Derived, Base, __COUNTER__, Message)
00066
00071 #define CLASS_LOADER_REGISTER_CLASS(Derived, Base) \
00072 CLASS_LOADER_REGISTER_CLASS_WITH_MESSAGE(Derived, Base, "")
00073
00074 #endif // CLASS_LOADER__REGISTER_MACRO_HPP_