00001 // -*- C++ -*- 00002 00003 //============================================================================= 00004 /** 00005 * @file BasicTypeTraits.h 00006 * 00007 * $Id: BasicTypeTraits.h 88803 2010-02-02 11:13:27Z vzykov $ 00008 * 00009 * Specializations of template traits in BasicTypeTraits_T.h. 00010 * 00011 * @author Jeff Parsons <j.parsons@vanderbilt.edu> 00012 */ 00013 //============================================================================= 00014 00015 #ifndef BASIC_TYPE_TRAITS_H 00016 #define BASIC_TYPE_TRAITS_H 00017 00018 #include "tao/AnyTypeCode/BasicTypeTraits_T.h" 00019 #include "tao/AnyTypeCode/Any.h" 00020 00021 #include "tao/Typecode_typesC.h" 00022 00023 #if !defined (ACE_LACKS_PRAGMA_ONCE) 00024 # pragma once 00025 #endif /* ACE_LACKS_PRAGMA_ONCE */ 00026 00027 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00028 00029 namespace CORBA 00030 { 00031 class TypeCode; 00032 typedef TypeCode * TypeCode_ptr; 00033 00034 class BooleanSeq; 00035 class CharSeq; 00036 class OctetSeq; 00037 class WCharSeq; 00038 class ShortSeq; 00039 class UShortSeq; 00040 class LongSeq; 00041 class ULongSeq; 00042 class LongLongSeq; 00043 class ULongLongSeq; 00044 class FloatSeq; 00045 class DoubleSeq; 00046 class LongDoubleSeq; 00047 class AnySeq; 00048 } 00049 00050 namespace TAO 00051 { 00052 template<> 00053 struct TAO_AnyTypeCode_Export BasicTypeTraits<CORBA::Boolean> 00054 { 00055 static CORBA::TypeCode_ptr const tc_value; 00056 static CORBA::TCKind const tckind_value; 00057 00058 typedef CORBA::Any::from_boolean insert_type; 00059 typedef CORBA::Any::to_boolean extract_type; 00060 typedef CORBA::Boolean return_type; 00061 00062 static return_type convert (extract_type& et); 00063 }; 00064 00065 template<> 00066 struct TAO_AnyTypeCode_Export BasicTypeTraits<CORBA::Octet> 00067 { 00068 static CORBA::TypeCode_ptr const tc_value; 00069 static CORBA::TCKind const tckind_value; 00070 00071 typedef CORBA::Any::from_octet insert_type; 00072 typedef CORBA::Any::to_octet extract_type; 00073 typedef CORBA::Octet return_type; 00074 00075 static return_type convert (extract_type& et); 00076 }; 00077 00078 template<> 00079 struct TAO_AnyTypeCode_Export BasicTypeTraits<CORBA::Char> 00080 { 00081 static CORBA::TypeCode_ptr const tc_value; 00082 static CORBA::TCKind const tckind_value; 00083 00084 typedef CORBA::Any::from_char insert_type; 00085 typedef CORBA::Any::to_char extract_type; 00086 typedef CORBA::Char return_type; 00087 00088 static return_type convert (extract_type& et); 00089 }; 00090 00091 #if (defined (ACE_HAS_WCHAR) || defined (ACE_HAS_XPG4_MULTIBYTE_CHAR)) && !defined (ACE_LACKS_NATIVE_WCHAR_T) 00092 template<> 00093 struct TAO_AnyTypeCode_Export BasicTypeTraits<CORBA::WChar> 00094 { 00095 static CORBA::TypeCode_ptr const tc_value; 00096 static CORBA::TCKind const tckind_value; 00097 00098 typedef CORBA::Any::from_wchar insert_type; 00099 typedef CORBA::Any::to_wchar extract_type; 00100 typedef CORBA::WChar return_type; 00101 00102 static return_type convert (extract_type& et); 00103 }; 00104 #endif 00105 00106 template<> 00107 struct TAO_AnyTypeCode_Export BasicTypeTraits<CORBA::Short> 00108 { 00109 static CORBA::TypeCode_ptr const tc_value; 00110 static CORBA::TCKind const tckind_value; 00111 00112 typedef CORBA::Short insert_type; 00113 typedef CORBA::Short extract_type; 00114 typedef CORBA::Short return_type; 00115 00116 static return_type convert (extract_type& et); 00117 }; 00118 00119 template<> 00120 struct TAO_AnyTypeCode_Export BasicTypeTraits<CORBA::UShort> 00121 { 00122 static CORBA::TypeCode_ptr const tc_value; 00123 static CORBA::TCKind const tckind_value; 00124 00125 typedef CORBA::UShort insert_type; 00126 typedef CORBA::UShort extract_type; 00127 typedef CORBA::UShort return_type; 00128 00129 static return_type convert (extract_type& et); 00130 }; 00131 00132 template<> 00133 struct TAO_AnyTypeCode_Export BasicTypeTraits<CORBA::Long> 00134 { 00135 static CORBA::TypeCode_ptr const tc_value; 00136 static CORBA::TCKind const tckind_value; 00137 00138 typedef CORBA::Long insert_type; 00139 typedef CORBA::Long extract_type; 00140 typedef CORBA::Long return_type; 00141 00142 static return_type convert (extract_type& et); 00143 }; 00144 00145 template<> 00146 struct TAO_AnyTypeCode_Export BasicTypeTraits<CORBA::ULong> 00147 { 00148 static CORBA::TypeCode_ptr const tc_value; 00149 static CORBA::TCKind const tckind_value; 00150 00151 typedef CORBA::ULong insert_type; 00152 typedef CORBA::ULong extract_type; 00153 typedef CORBA::ULong return_type; 00154 00155 static return_type convert (extract_type& et); 00156 }; 00157 00158 template<> 00159 struct TAO_AnyTypeCode_Export BasicTypeTraits<CORBA::LongLong> 00160 { 00161 static CORBA::TypeCode_ptr const tc_value; 00162 static CORBA::TCKind const tckind_value; 00163 00164 typedef CORBA::LongLong insert_type; 00165 typedef CORBA::LongLong extract_type; 00166 typedef CORBA::LongLong return_type; 00167 00168 static return_type convert (extract_type& et); 00169 }; 00170 00171 template<> 00172 struct TAO_AnyTypeCode_Export BasicTypeTraits<CORBA::ULongLong> 00173 { 00174 static CORBA::TypeCode_ptr const tc_value; 00175 static CORBA::TCKind const tckind_value; 00176 00177 typedef CORBA::ULongLong insert_type; 00178 typedef CORBA::ULongLong extract_type; 00179 typedef CORBA::ULongLong return_type; 00180 00181 static return_type convert (extract_type& et); 00182 }; 00183 00184 template<> 00185 struct TAO_AnyTypeCode_Export BasicTypeTraits<CORBA::Float> 00186 { 00187 static CORBA::TypeCode_ptr const tc_value; 00188 static CORBA::TCKind const tckind_value; 00189 00190 typedef CORBA::Float insert_type; 00191 typedef CORBA::Float extract_type; 00192 typedef CORBA::Float return_type; 00193 00194 static return_type convert (extract_type& et); 00195 }; 00196 00197 template<> 00198 struct TAO_AnyTypeCode_Export BasicTypeTraits<CORBA::Double> 00199 { 00200 static CORBA::TypeCode_ptr const tc_value; 00201 static CORBA::TCKind const tckind_value; 00202 00203 typedef CORBA::Double insert_type; 00204 typedef CORBA::Double extract_type; 00205 typedef CORBA::Double return_type; 00206 00207 static return_type convert (extract_type& et); 00208 }; 00209 00210 template<> 00211 struct TAO_AnyTypeCode_Export BasicTypeTraits<CORBA::LongDouble> 00212 { 00213 static CORBA::TypeCode_ptr const tc_value; 00214 static CORBA::TCKind const tckind_value; 00215 00216 typedef CORBA::LongDouble insert_type; 00217 typedef CORBA::LongDouble extract_type; 00218 typedef CORBA::LongDouble return_type; 00219 00220 static return_type convert (extract_type& et); 00221 }; 00222 00223 template<> 00224 struct TAO_AnyTypeCode_Export BasicTypeTraits<CORBA::Char *> 00225 { 00226 static CORBA::TypeCode_ptr const tc_value; 00227 static CORBA::TCKind const tckind_value; 00228 00229 typedef CORBA::Char * insert_type; 00230 typedef CORBA::Char * extract_type; 00231 typedef CORBA::Char * return_type; 00232 00233 static return_type convert (extract_type& et); 00234 }; 00235 00236 template<> 00237 struct TAO_AnyTypeCode_Export BasicTypeTraits<CORBA::WChar *> 00238 { 00239 static CORBA::TypeCode_ptr const tc_value; 00240 static CORBA::TCKind const tckind_value; 00241 00242 typedef CORBA::WChar * insert_type; 00243 typedef CORBA::WChar * extract_type; 00244 typedef CORBA::WChar * return_type; 00245 00246 static return_type convert (extract_type& et); 00247 }; 00248 00249 template<> 00250 struct TAO_AnyTypeCode_Export BasicTypeTraits<CORBA::Any> 00251 { 00252 static CORBA::TypeCode_ptr const tc_value; 00253 static CORBA::TCKind const tckind_value; 00254 00255 typedef CORBA::Any insert_type; 00256 typedef CORBA::Any * extract_type; 00257 typedef CORBA::Any * return_type; 00258 00259 static return_type convert (extract_type& et); 00260 }; 00261 00262 template<> 00263 struct TAO_AnyTypeCode_Export BasicTypeTraits<CORBA::Object_ptr> 00264 { 00265 static CORBA::TypeCode_ptr const tc_value; 00266 static CORBA::TCKind const tckind_value; 00267 00268 typedef CORBA::Object_ptr insert_type; 00269 typedef CORBA::Object_ptr extract_type; 00270 typedef CORBA::Object_ptr return_type; 00271 00272 static return_type convert (extract_type& et); 00273 }; 00274 00275 template<> 00276 struct TAO_AnyTypeCode_Export BasicTypeTraits<CORBA::TypeCode_ptr> 00277 { 00278 static CORBA::TypeCode_ptr const tc_value; 00279 static CORBA::TCKind const tckind_value; 00280 00281 typedef CORBA::TypeCode_ptr insert_type; 00282 typedef CORBA::TypeCode_ptr extract_type; 00283 typedef CORBA::TypeCode_ptr return_type; 00284 00285 static return_type convert (extract_type& et); 00286 }; 00287 00288 template<> 00289 struct TAO_AnyTypeCode_Export BasicTypeTraits<CORBA::BooleanSeq> 00290 { 00291 static CORBA::TypeCode_ptr const tc_value; 00292 static CORBA::TCKind const tckind_value; 00293 00294 typedef CORBA::BooleanSeq insert_type; 00295 typedef CORBA::BooleanSeq * extract_type; 00296 typedef CORBA::BooleanSeq * return_type; 00297 00298 static return_type convert (extract_type& et); 00299 }; 00300 00301 template<> 00302 struct TAO_AnyTypeCode_Export BasicTypeTraits<CORBA::OctetSeq> 00303 { 00304 static CORBA::TypeCode_ptr const tc_value; 00305 static CORBA::TCKind const tckind_value ; 00306 00307 typedef CORBA::OctetSeq insert_type; 00308 typedef CORBA::OctetSeq * extract_type; 00309 typedef CORBA::OctetSeq * return_type; 00310 00311 static return_type convert (extract_type& et); 00312 }; 00313 00314 template<> 00315 struct TAO_AnyTypeCode_Export BasicTypeTraits<CORBA::CharSeq> 00316 { 00317 static CORBA::TypeCode_ptr const tc_value; 00318 static CORBA::TCKind const tckind_value; 00319 00320 typedef CORBA::CharSeq insert_type; 00321 typedef CORBA::CharSeq * extract_type; 00322 typedef CORBA::CharSeq * return_type; 00323 00324 static return_type convert (extract_type& et); 00325 }; 00326 00327 template<> 00328 struct TAO_AnyTypeCode_Export BasicTypeTraits<CORBA::WCharSeq> 00329 { 00330 static CORBA::TypeCode_ptr const tc_value; 00331 static CORBA::TCKind const tckind_value; 00332 00333 typedef CORBA::WCharSeq insert_type; 00334 typedef CORBA::WCharSeq * extract_type; 00335 typedef CORBA::WCharSeq * return_type; 00336 00337 static return_type convert (extract_type& et); 00338 }; 00339 00340 template<> 00341 struct TAO_AnyTypeCode_Export BasicTypeTraits<CORBA::ShortSeq> 00342 { 00343 static CORBA::TypeCode_ptr const tc_value; 00344 static CORBA::TCKind const tckind_value; 00345 00346 typedef CORBA::ShortSeq insert_type; 00347 typedef CORBA::ShortSeq * extract_type; 00348 typedef CORBA::ShortSeq * return_type; 00349 00350 static return_type convert (extract_type& et); 00351 }; 00352 00353 template<> 00354 struct TAO_AnyTypeCode_Export BasicTypeTraits<CORBA::UShortSeq> 00355 { 00356 static CORBA::TypeCode_ptr const tc_value; 00357 static CORBA::TCKind const tckind_value; 00358 00359 typedef CORBA::UShortSeq insert_type; 00360 typedef CORBA::UShortSeq * extract_type; 00361 typedef CORBA::UShortSeq * return_type; 00362 00363 static return_type convert (extract_type& et); 00364 }; 00365 00366 template<> 00367 struct TAO_AnyTypeCode_Export BasicTypeTraits<CORBA::LongSeq> 00368 { 00369 static CORBA::TypeCode_ptr const tc_value; 00370 static CORBA::TCKind const tckind_value; 00371 00372 typedef CORBA::LongSeq insert_type; 00373 typedef CORBA::LongSeq * extract_type; 00374 typedef CORBA::LongSeq * return_type; 00375 00376 static return_type convert (extract_type& et); 00377 }; 00378 00379 template<> 00380 struct TAO_AnyTypeCode_Export BasicTypeTraits<CORBA::ULongSeq> 00381 { 00382 static CORBA::TypeCode_ptr const tc_value; 00383 static CORBA::TCKind const tckind_value; 00384 00385 typedef CORBA::ULongSeq insert_type; 00386 typedef CORBA::ULongSeq * extract_type; 00387 typedef CORBA::ULongSeq * return_type; 00388 00389 static return_type convert (extract_type& et); 00390 }; 00391 00392 template<> 00393 struct TAO_AnyTypeCode_Export BasicTypeTraits<CORBA::LongLongSeq> 00394 { 00395 static CORBA::TypeCode_ptr const tc_value; 00396 static CORBA::TCKind const tckind_value; 00397 00398 typedef CORBA::LongLongSeq insert_type; 00399 typedef CORBA::LongLongSeq * extract_type; 00400 typedef CORBA::LongLongSeq * return_type; 00401 00402 static return_type convert (extract_type& et); 00403 }; 00404 00405 template<> 00406 struct TAO_AnyTypeCode_Export BasicTypeTraits<CORBA::ULongLongSeq> 00407 { 00408 static CORBA::TypeCode_ptr const tc_value; 00409 static CORBA::TCKind const tckind_value; 00410 00411 typedef CORBA::ULongLongSeq insert_type; 00412 typedef CORBA::ULongLongSeq * extract_type; 00413 typedef CORBA::ULongLongSeq * return_type; 00414 00415 static return_type convert (extract_type& et); 00416 }; 00417 00418 template<> 00419 struct TAO_AnyTypeCode_Export BasicTypeTraits<CORBA::FloatSeq> 00420 { 00421 static CORBA::TypeCode_ptr const tc_value; 00422 static CORBA::TCKind const tckind_value; 00423 00424 typedef CORBA::FloatSeq insert_type; 00425 typedef CORBA::FloatSeq * extract_type; 00426 typedef CORBA::FloatSeq * return_type; 00427 00428 static return_type convert (extract_type& et); 00429 }; 00430 00431 template<> 00432 struct TAO_AnyTypeCode_Export BasicTypeTraits<CORBA::DoubleSeq> 00433 { 00434 static CORBA::TypeCode_ptr const tc_value; 00435 static CORBA::TCKind const tckind_value; 00436 00437 typedef CORBA::DoubleSeq insert_type; 00438 typedef CORBA::DoubleSeq * extract_type; 00439 typedef CORBA::DoubleSeq * return_type; 00440 00441 static return_type convert (extract_type& et); 00442 }; 00443 00444 template<> 00445 struct TAO_AnyTypeCode_Export BasicTypeTraits<CORBA::LongDoubleSeq> 00446 { 00447 static CORBA::TypeCode_ptr const tc_value; 00448 static CORBA::TCKind const tckind_value; 00449 00450 typedef CORBA::LongDoubleSeq insert_type; 00451 typedef CORBA::LongDoubleSeq * extract_type; 00452 typedef CORBA::LongDoubleSeq * return_type; 00453 00454 static return_type convert (extract_type& et); 00455 }; 00456 00457 template<> 00458 struct TAO_AnyTypeCode_Export BasicTypeTraits<CORBA::AnySeq> 00459 { 00460 static CORBA::TypeCode_ptr const tc_value; 00461 static CORBA::TCKind const tckind_value; 00462 00463 typedef CORBA::AnySeq insert_type; 00464 typedef CORBA::AnySeq * extract_type; 00465 typedef CORBA::AnySeq * return_type; 00466 00467 static return_type convert (extract_type& et); 00468 }; 00469 } 00470 00471 TAO_END_VERSIONED_NAMESPACE_DECL 00472 00473 #endif /* BASIC_TYPE_TRAITS_H */