00001 #if !defined(MCTypeTraits_H_)
00002 #define MCTypeTraits_H_
00003
00004 #ident "@(#)$Id: MCTypeTraits.h,v 1.5 2004/12/02 07:05:20 mike Exp $"
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #include "mcllib/MCTypes.h"
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041 namespace mcllib
00042 {
00051 template<typename T>
00052 struct MCTypeTraits {
00054 typedef T underlying_type;
00055 enum {
00057 destruct_opt = 0,
00059 copy_opt = 0,
00061 assign_opt = 0,
00063 is_pod = 0
00064 };
00068 typedef const underlying_type& copy_param_type;
00072 typedef const underlying_type& copy_return_type;
00073 };
00074
00079 template<>
00080 struct MCTypeTraits<bool> {
00081 typedef bool underlying_type;
00082 enum { destruct_opt = 1, copy_opt = 1, assign_opt = 1, is_pod = 1 };
00083 typedef underlying_type copy_param_type;
00084 typedef underlying_type copy_return_type;
00085 };
00086
00091 template<>
00092 struct MCTypeTraits<mcllib::mcint8> {
00093 typedef mcllib::mcint8 underlying_type;
00094 enum { destruct_opt = 1, copy_opt = 1, assign_opt = 1, is_pod = 1 };
00095 typedef underlying_type copy_param_type;
00096 typedef underlying_type copy_return_type;
00097 };
00098
00103 template<>
00104 struct MCTypeTraits<mcllib::mcuint8> {
00105 typedef mcllib::mcuint8 underlying_type;
00106 enum { destruct_opt = 1, copy_opt = 1, assign_opt = 1, is_pod = 1 };
00107 typedef underlying_type copy_param_type;
00108 typedef underlying_type copy_return_type;
00109 };
00110
00115 template<>
00116 struct MCTypeTraits<mcllib::mcint16> {
00117 typedef mcllib::mcint16 underlying_type;
00118 enum { destruct_opt = 1, copy_opt = 1, assign_opt = 1, is_pod = 1 };
00119 typedef underlying_type copy_param_type;
00120 typedef underlying_type copy_return_type;
00121 };
00122
00127 template<>
00128 struct MCTypeTraits<mcllib::mcuint16> {
00129 typedef mcllib::mcuint16 underlying_type;
00130 enum { destruct_opt = 1, copy_opt = 1, assign_opt = 1, is_pod = 1 };
00131 typedef underlying_type copy_param_type;
00132 typedef underlying_type copy_return_type;
00133 };
00134
00139 template<>
00140 struct MCTypeTraits<mcllib::mcint32> {
00141 typedef mcllib::mcint32 underlying_type;
00142 enum { destruct_opt = 1, copy_opt = 1, assign_opt = 1, is_pod = 1 };
00143 typedef underlying_type copy_param_type;
00144 typedef underlying_type copy_return_type;
00145 };
00146
00151 template<>
00152 struct MCTypeTraits<mcllib::mcuint32> {
00153 typedef mcllib::mcuint32 underlying_type;
00154 enum { destruct_opt = 1, copy_opt = 1, assign_opt = 1, is_pod = 1 };
00155 typedef underlying_type copy_param_type;
00156 typedef underlying_type copy_return_type;
00157 };
00158
00163 template<>
00164 struct MCTypeTraits<mcllib::mcint64> {
00165 typedef mcllib::mcint64 underlying_type;
00166 enum { destruct_opt = 1, copy_opt = 1, assign_opt = 1, is_pod = 1 };
00167 typedef const underlying_type& copy_param_type;
00168 typedef const underlying_type& copy_return_type;
00169 };
00170
00175 template<>
00176 struct MCTypeTraits<mcllib::mcuint64> {
00177 typedef mcllib::mcuint64 underlying_type;
00178 enum { destruct_opt = 1, copy_opt = 1, assign_opt = 1, is_pod = 1 };
00179 typedef const underlying_type& copy_param_type;
00180 typedef const underlying_type& copy_return_type;
00181 };
00182
00187 template<>
00188 struct MCTypeTraits<mcllib::mcfloat32> {
00189 typedef mcllib::mcfloat32 underlying_type;
00190 enum { destruct_opt = 1, copy_opt = 1, assign_opt = 1, is_pod = 1 };
00191 typedef underlying_type copy_param_type;
00192 typedef underlying_type copy_return_type;
00193 };
00194
00199 template<>
00200 struct MCTypeTraits<mcllib::mcfloat64> {
00201 typedef mcllib::mcfloat64 underlying_type;
00202 enum { destruct_opt = 1, copy_opt = 1, assign_opt = 1, is_pod = 1 };
00203 typedef const underlying_type& copy_param_type;
00204 typedef const underlying_type& copy_return_type;
00205 };
00206
00207 };
00208
00209 #endif