Mirror reflection library 0.5.13
|
00001 00006 #ifndef MIRROR_LIBS_EXAMPLES_CLASSES_1011291729_HPP 00007 #define MIRROR_LIBS_EXAMPLES_CLASSES_1011291729_HPP 00008 00009 #include <mirror/meta_class.hpp> 00010 #include <mirror/meta_enum.hpp> 00011 00012 namespace test { 00013 00014 struct A 00015 { 00016 int a; 00017 }; 00018 00019 struct B 00020 { 00021 bool b; 00022 }; 00023 00024 struct C 00025 : virtual public A 00026 , virtual public B 00027 { 00028 char c; 00029 }; 00030 00031 struct D 00032 : virtual public A 00033 , virtual public B 00034 { 00035 double d; 00036 }; 00037 00038 struct E 00039 : virtual public C 00040 , virtual public D 00041 { 00042 double e; 00043 }; 00044 00045 struct F 00046 : public E 00047 , virtual public C 00048 , virtual public D 00049 { 00050 float f; 00051 }; 00052 00053 struct G 00054 { 00055 short g; 00056 }; 00057 00058 struct H 00059 : public F 00060 , public G 00061 { 00062 long h; 00063 }; 00064 00065 enum class Ch 00066 { 00067 null = '\0', 00068 bell = '\a', 00069 linefeed = '\n', 00070 carriage_return = '\r', 00071 horizontal_tab = '\t', 00072 formfeed = '\f' 00073 }; 00074 00075 class I 00076 { 00077 private: 00078 static int i; 00079 MIRROR_FRIENDLY_CLASS(I); 00080 public: 00081 int get_i(void) const 00082 { 00083 return i; 00084 } 00085 00086 void set_i(int _i) 00087 { 00088 i = _i; 00089 } 00090 }; 00091 00092 int I::i = 0; 00093 00094 struct J : public I 00095 { 00096 unsigned j; 00097 }; 00098 00099 } // namespace test 00100 00101 MIRROR_REG_BEGIN 00102 00103 MIRROR_REG_OBJECT_TAG(hidden) 00104 00105 MIRROR_QREG_GLOBAL_SCOPE_NAMESPACE(test) 00106 00107 MIRROR_REG_CLASS_BEGIN(struct, test, A) 00108 MIRROR_REG_CLASS_END 00109 00110 MIRROR_TAG_TYPE(test::A, (hidden)) 00111 00112 MIRROR_REG_CLASS_BEGIN(struct, test, B) 00113 MIRROR_REG_CLASS_END 00114 00115 MIRROR_TAG_TYPE(test::B, (hidden)) 00116 00117 MIRROR_REG_CLASS_BEGIN(struct, test, C) 00118 // register base classes 00119 MIRROR_REG_BASE_CLASSES_BEGIN 00120 MIRROR_REG_BASE_CLASS(virtual, _, test::A), 00121 MIRROR_REG_BASE_CLASS(virtual, _, test::B) 00122 MIRROR_REG_BASE_CLASSES_END 00123 // register member variables 00124 MIRROR_REG_CLASS_MEM_VARS_BEGIN 00125 MIRROR_REG_CLASS_MEM_VAR(_, _, _, c) 00126 MIRROR_REG_CLASS_MEM_VARS_END 00127 MIRROR_REG_CLASS_END 00128 00129 MIRROR_REG_CLASS_BEGIN(struct, test, D) 00130 // register base classes 00131 MIRROR_REG_BASE_CLASSES_BEGIN 00132 MIRROR_REG_BASE_CLASS(virtual, _, test::A), 00133 MIRROR_REG_BASE_CLASS(virtual, _, test::B) 00134 MIRROR_REG_BASE_CLASSES_END 00135 // register member variables 00136 MIRROR_REG_CLASS_MEM_VARS_BEGIN 00137 MIRROR_REG_CLASS_MEM_VAR(_, _, _, d) 00138 MIRROR_REG_CLASS_MEM_VARS_END 00139 MIRROR_REG_CLASS_END 00140 00141 MIRROR_REG_CLASS_BEGIN(struct, test, E) 00142 // register base classes 00143 MIRROR_REG_BASE_CLASSES_BEGIN 00144 MIRROR_REG_BASE_CLASS(virtual, _, test::C), 00145 MIRROR_REG_BASE_CLASS(virtual, _, test::D) 00146 MIRROR_REG_BASE_CLASSES_END 00147 // register member variables 00148 MIRROR_REG_CLASS_MEM_VARS_BEGIN 00149 MIRROR_REG_CLASS_MEM_VAR(_, _, _, e) 00150 MIRROR_REG_CLASS_MEM_VARS_END 00151 MIRROR_REG_CLASS_END 00152 00153 MIRROR_REG_CLASS_BEGIN(struct, test, F) 00154 // register base classes 00155 MIRROR_REG_BASE_CLASSES_BEGIN 00156 MIRROR_REG_BASE_CLASS(_, _, test::E), 00157 MIRROR_REG_BASE_CLASS(virtual, _, test::C), 00158 MIRROR_REG_BASE_CLASS(virtual, _, test::D) 00159 MIRROR_REG_BASE_CLASSES_END 00160 // register member variables 00161 MIRROR_REG_CLASS_MEM_VARS_BEGIN 00162 MIRROR_REG_CLASS_MEM_VAR(_, _, _, f) 00163 MIRROR_REG_CLASS_MEM_VARS_END 00164 MIRROR_REG_CLASS_END 00165 00166 MIRROR_REG_CLASS_BEGIN(struct, test, G) 00167 MIRROR_REG_CLASS_MEM_VARS_BEGIN 00168 MIRROR_REG_CLASS_MEM_VAR(_, _, _, g) 00169 MIRROR_REG_CLASS_MEM_VARS_END 00170 MIRROR_REG_CLASS_END 00171 00172 MIRROR_REG_CLASS_BEGIN(struct, test, H) 00173 // register base classes 00174 MIRROR_REG_BASE_CLASSES_BEGIN 00175 MIRROR_REG_BASE_CLASS(_, _, test::F), 00176 MIRROR_REG_BASE_CLASS(_, _, test::G) 00177 MIRROR_REG_BASE_CLASSES_END 00178 // register member variables 00179 MIRROR_REG_CLASS_MEM_VARS_BEGIN 00180 MIRROR_REG_CLASS_MEM_VAR(_, _, _, h) 00181 MIRROR_REG_CLASS_MEM_VARS_END 00182 MIRROR_REG_CLASS_END 00183 00184 MIRROR_REG_ENUM_BEGIN(test, Ch) 00185 MIRROR_REG_ENUM_VALUE(null) 00186 MIRROR_REG_ENUM_VALUE(bell) 00187 MIRROR_REG_ENUM_VALUE(linefeed) 00188 MIRROR_REG_ENUM_VALUE(carriage_return) 00189 MIRROR_REG_ENUM_VALUE(horizontal_tab) 00190 MIRROR_REG_ENUM_VALUE(formfeed) 00191 MIRROR_REG_ENUM_END 00192 00193 MIRROR_REG_CLASS_BEGIN(class, test, I) 00194 MIRROR_REG_CLASS_MEM_VARS_BEGIN 00195 MIRROR_REG_CLASS_MEM_VAR_GET_SET(private, static, int, i, _.get_i(), _.set_i(_i)) 00196 MIRROR_REG_CLASS_MEM_VARS_END 00197 MIRROR_REG_CLASS_END 00198 00199 MIRROR_REG_CLASS_BEGIN(struct, test, J) 00200 MIRROR_REG_BASE_CLASSES_BEGIN 00201 MIRROR_REG_BASE_CLASS(_, _, test::I) 00202 MIRROR_REG_BASE_CLASSES_END 00203 MIRROR_REG_CLASS_MEM_VARS_BEGIN 00204 MIRROR_REG_CLASS_MEM_VAR(_, _, _, j) 00205 MIRROR_REG_CLASS_MEM_VARS_END 00206 MIRROR_REG_CLASS_END 00207 00208 MIRROR_REG_END 00209 00210 #endif