00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef TOOL_STATIC_BASE_HH_
00023 # define TOOL_STATIC_BASE_HH_
00024
00033 namespace wpl
00034 {
00035
00037 namespace tool
00038 {
00039
00045 struct bottom
00046 {
00047 };
00048
00054 struct undefined_type
00055 {
00056 };
00057
00068 template <class Down, class Up>
00069 struct get_exact
00070 {
00071 typedef Down return_type;
00072 };
00073
00078 template <class Up>
00079 struct get_exact<bottom, Up>
00080 {
00081 typedef Up return_type;
00082 };
00083
00084 # define WP_GET_EXACT(Down, Up...) \
00085 typename ::wpl::tool::get_exact<Down, Up>::return_type
00086
00155 template <class Bottom>
00156 struct static_base
00157 {
00162 typedef WP_GET_EXACT(Bottom, static_base<Bottom>) exact_type;
00163
00165
00166
00167
00169 const exact_type& exact() const;
00170
00172 exact_type& exact();
00173
00175 const exact_type* exact_ptr() const;
00176
00178 exact_type* exact_ptr();
00180 };
00181
00182 # define WP_INHERIT(Class, Parent...) Class<WP_GET_EXACT(Bottom, Parent)>
00183
00223 template <class Type>
00224 struct types
00225 {
00226 };
00227
00228 # define WP_TYPE_(Type, Base...) ::wpl::tool::types<Base>::Type
00229 # define WP_TYPE(Type, Base...) typename WP_TYPE_(Type, Base)
00230
00231 }
00232
00233 }
00234
00235 # include "static_base.hxx"
00236
00237 #endif // ! TOOL_STATIC_BASE_HH_