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 #ifndef CASA_LECANONICALCONVERSION_H
00029 #define CASA_LECANONICALCONVERSION_H
00030
00031
00032 #include <casacore/casa/aips.h>
00033 #include <casacore/casa/OS/Conversion.h>
00034 #include <cstring>
00035
00036
00037 namespace casacore {
00038
00039
00040
00041
00042 #define SIZE_LECAN_CHAR 1
00043 #define SIZE_LECAN_UCHAR 1
00044 #define SIZE_LECAN_SHORT 2
00045 #define SIZE_LECAN_USHORT 2
00046 #define SIZE_LECAN_INT 4
00047 #define SIZE_LECAN_UINT 4
00048 #define SIZE_LECAN_INT64 8
00049 #define SIZE_LECAN_UINT64 8
00050 #define SIZE_LECAN_FLOAT 4
00051 #define SIZE_LECAN_DOUBLE 8
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066 #define CONVERT_LECAN_CHAR 0
00067 #define CONVERT_LECAN_UCHAR 0
00068
00069 #if !defined(AIPS_LITTLE_ENDIAN)
00070 # define CONVERT_LECAN_SHORT 1
00071 # define CONVERT_LECAN_USHORT 1
00072 # define CONVERT_LECAN_INT 1
00073 # define CONVERT_LECAN_UINT 1
00074 # define CONVERT_LECAN_INT64 1
00075 # define CONVERT_LECAN_UINT64 1
00076 # define CONVERT_LECAN_FLOAT 1
00077 # define CONVERT_LECAN_DOUBLE 1
00078
00079 #else
00080
00081
00082
00083 # define CONVERT_LECAN_SHORT 0
00084 # define CONVERT_LECAN_USHORT 0
00085 # define CONVERT_LECAN_INT 0
00086 # define CONVERT_LECAN_UINT 0
00087 # define CONVERT_LECAN_INT64 0
00088 # define CONVERT_LECAN_UINT64 0
00089 # define CONVERT_LECAN_FLOAT 0
00090 # define CONVERT_LECAN_DOUBLE 0
00091
00092
00093 #endif
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160 class LECanonicalConversion
00161 {
00162 public:
00163
00164
00165
00166 static size_t toLocal (char& to, const void* from);
00167 static size_t toLocal (unsigned char& to, const void* from);
00168 static size_t toLocal (short& to, const void* from);
00169 static size_t toLocal (unsigned short& to, const void* from);
00170 static size_t toLocal (int& to, const void* from);
00171 static size_t toLocal (unsigned int& to, const void* from);
00172 static size_t toLocal (Int64& to, const void* from);
00173 static size_t toLocal (uInt64& to, const void* from);
00174 static size_t toLocal (float& to, const void* from);
00175 static size_t toLocal (double& to, const void* from);
00176
00177
00178
00179
00180
00181 static size_t fromLocal (void* to, const char& from);
00182 static size_t fromLocal (void* to, const unsigned char& from);
00183 static size_t fromLocal (void* to, const short& from);
00184 static size_t fromLocal (void* to, const unsigned short& from);
00185 static size_t fromLocal (void* to, const int& from);
00186 static size_t fromLocal (void* to, const unsigned int& from);
00187 static size_t fromLocal (void* to, const Int64& from);
00188 static size_t fromLocal (void* to, const uInt64& from);
00189 static size_t fromLocal (void* to, const float& from);
00190 static size_t fromLocal (void* to, const double& from);
00191
00192
00193
00194
00195
00196 static size_t toLocal (char* to, const void* from,
00197 size_t nr);
00198 static size_t toLocal (unsigned char* to, const void* from,
00199 size_t nr);
00200 static size_t toLocal (short* to, const void* from,
00201 size_t nr);
00202 static size_t toLocal (unsigned short* to, const void* from,
00203 size_t nr);
00204 static size_t toLocal (int* to, const void* from,
00205 size_t nr);
00206 static size_t toLocal (unsigned int* to, const void* from,
00207 size_t nr);
00208 static size_t toLocal (Int64* to, const void* from,
00209 size_t nr);
00210 static size_t toLocal (uInt64* to, const void* from,
00211 size_t nr);
00212 static size_t toLocal (float* to, const void* from,
00213 size_t nr);
00214 static size_t toLocal (double* to, const void* from,
00215 size_t nr);
00216
00217
00218
00219
00220
00221 static size_t fromLocal (void* to, const char* from,
00222 size_t nr);
00223 static size_t fromLocal (void* to, const unsigned char* from,
00224 size_t nr);
00225 static size_t fromLocal (void* to, const short* from,
00226 size_t nr);
00227 static size_t fromLocal (void* to, const unsigned short* from,
00228 size_t nr);
00229 static size_t fromLocal (void* to, const int* from,
00230 size_t nr);
00231 static size_t fromLocal (void* to, const unsigned int* from,
00232 size_t nr);
00233 static size_t fromLocal (void* to, const Int64* from,
00234 size_t nr);
00235 static size_t fromLocal (void* to, const uInt64* from,
00236 size_t nr);
00237 static size_t fromLocal (void* to, const float* from,
00238 size_t nr);
00239 static size_t fromLocal (void* to, const double* from,
00240 size_t nr);
00241
00242
00243
00244
00245
00246 static size_t toLocalChar (void* to, const void* from,
00247 size_t nr);
00248 static size_t toLocalUChar (void* to, const void* from,
00249 size_t nr);
00250 static size_t toLocalShort (void* to, const void* from,
00251 size_t nr);
00252 static size_t toLocalUShort (void* to, const void* from,
00253 size_t nr);
00254 static size_t toLocalInt (void* to, const void* from,
00255 size_t nr);
00256 static size_t toLocalUInt (void* to, const void* from,
00257 size_t nr);
00258 static size_t toLocalInt64 (void* to, const void* from,
00259 size_t nr);
00260 static size_t toLocalUInt64 (void* to, const void* from,
00261 size_t nr);
00262 static size_t toLocalFloat (void* to, const void* from,
00263 size_t nr);
00264 static size_t toLocalDouble (void* to, const void* from,
00265 size_t nr);
00266
00267
00268
00269
00270
00271 static size_t fromLocalChar (void* to, const void* from,
00272 size_t nr);
00273 static size_t fromLocalUChar (void* to, const void* from,
00274 size_t nr);
00275 static size_t fromLocalShort (void* to, const void* from,
00276 size_t nr);
00277 static size_t fromLocalUShort (void* to, const void* from,
00278 size_t nr);
00279 static size_t fromLocalInt (void* to, const void* from,
00280 size_t nr);
00281 static size_t fromLocalUInt (void* to, const void* from,
00282 size_t nr);
00283 static size_t fromLocalInt64 (void* to, const void* from,
00284 size_t nr);
00285 static size_t fromLocalUInt64 (void* to, const void* from,
00286 size_t nr);
00287 static size_t fromLocalFloat (void* to, const void* from,
00288 size_t nr);
00289 static size_t fromLocalDouble (void* to, const void* from,
00290 size_t nr);
00291
00292
00293
00294
00295
00296
00297
00298
00299
00300 static void* byteToLocalChar (void* to, const void* from,
00301 size_t nrbytes);
00302 static void* byteToLocalUChar (void* to, const void* from,
00303 size_t nrbytes);
00304 static void* byteToLocalShort (void* to, const void* from,
00305 size_t nrbytes);
00306 static void* byteToLocalUShort (void* to, const void* from,
00307 size_t nrbytes);
00308 static void* byteToLocalInt (void* to, const void* from,
00309 size_t nrbytes);
00310 static void* byteToLocalUInt (void* to, const void* from,
00311 size_t nrbytes);
00312 static void* byteToLocalInt64 (void* to, const void* from,
00313 size_t nrbytes);
00314 static void* byteToLocalUInt64 (void* to, const void* from,
00315 size_t nrbytes);
00316 static void* byteToLocalFloat (void* to, const void* from,
00317 size_t nrbytes);
00318 static void* byteToLocalDouble (void* to, const void* from,
00319 size_t nrbytes);
00320
00321
00322
00323
00324
00325
00326
00327
00328
00329 static void* byteFromLocalChar (void* to, const void* from,
00330 size_t nrbytes);
00331 static void* byteFromLocalUChar (void* to, const void* from,
00332 size_t nrbytes);
00333 static void* byteFromLocalShort (void* to, const void* from,
00334 size_t nrbytes);
00335 static void* byteFromLocalUShort (void* to, const void* from,
00336 size_t nrbytes);
00337 static void* byteFromLocalInt (void* to, const void* from,
00338 size_t nrbytes);
00339 static void* byteFromLocalUInt (void* to, const void* from,
00340 size_t nrbytes);
00341 static void* byteFromLocalInt64 (void* to, const void* from,
00342 size_t nrbytes);
00343 static void* byteFromLocalUInt64 (void* to, const void* from,
00344 size_t nrbytes);
00345 static void* byteFromLocalFloat (void* to, const void* from,
00346 size_t nrbytes);
00347 static void* byteFromLocalDouble (void* to, const void* from,
00348 size_t nrbytes);
00349
00350
00351
00352
00353 static Conversion::ValueFunction* getToLocal (const char*);
00354 static Conversion::ValueFunction* getToLocal (const unsigned char*);
00355 static Conversion::ValueFunction* getToLocal (const short*);
00356 static Conversion::ValueFunction* getToLocal (const unsigned short*);
00357 static Conversion::ValueFunction* getToLocal (const int*);
00358 static Conversion::ValueFunction* getToLocal (const unsigned int*);
00359 static Conversion::ValueFunction* getToLocal (const Int64*);
00360 static Conversion::ValueFunction* getToLocal (const uInt64*);
00361 static Conversion::ValueFunction* getToLocal (const float*);
00362 static Conversion::ValueFunction* getToLocal (const double*);
00363 static Conversion::ValueFunction* getFromLocal (const char*);
00364 static Conversion::ValueFunction* getFromLocal (const unsigned char*);
00365 static Conversion::ValueFunction* getFromLocal (const short*);
00366 static Conversion::ValueFunction* getFromLocal (const unsigned short*);
00367 static Conversion::ValueFunction* getFromLocal (const int*);
00368 static Conversion::ValueFunction* getFromLocal (const unsigned int*);
00369 static Conversion::ValueFunction* getFromLocal (const Int64*);
00370 static Conversion::ValueFunction* getFromLocal (const uInt64*);
00371 static Conversion::ValueFunction* getFromLocal (const float*);
00372 static Conversion::ValueFunction* getFromLocal (const double*);
00373
00374
00375
00376
00377
00378
00379 static Conversion::ByteFunction* getByteToLocal (const char*);
00380 static Conversion::ByteFunction* getByteToLocal (const unsigned char*);
00381 static Conversion::ByteFunction* getByteToLocal (const short*);
00382 static Conversion::ByteFunction* getByteToLocal (const unsigned short*);
00383 static Conversion::ByteFunction* getByteToLocal (const int*);
00384 static Conversion::ByteFunction* getByteToLocal (const unsigned int*);
00385 static Conversion::ByteFunction* getByteToLocal (const Int64*);
00386 static Conversion::ByteFunction* getByteToLocal (const uInt64*);
00387 static Conversion::ByteFunction* getByteToLocal (const float*);
00388 static Conversion::ByteFunction* getByteToLocal (const double*);
00389 static Conversion::ByteFunction* getByteFromLocal (const char*);
00390 static Conversion::ByteFunction* getByteFromLocal (const unsigned char*);
00391 static Conversion::ByteFunction* getByteFromLocal (const short*);
00392 static Conversion::ByteFunction* getByteFromLocal (const unsigned short*);
00393 static Conversion::ByteFunction* getByteFromLocal (const int*);
00394 static Conversion::ByteFunction* getByteFromLocal (const unsigned int*);
00395 static Conversion::ByteFunction* getByteFromLocal (const Int64*);
00396 static Conversion::ByteFunction* getByteFromLocal (const uInt64*);
00397 static Conversion::ByteFunction* getByteFromLocal (const float*);
00398 static Conversion::ByteFunction* getByteFromLocal (const double*);
00399
00400
00401
00402
00403 static unsigned int canonicalSize (const char*);
00404 static unsigned int canonicalSize (const unsigned char*);
00405 static unsigned int canonicalSize (const short*);
00406 static unsigned int canonicalSize (const unsigned short*);
00407 static unsigned int canonicalSize (const int*);
00408 static unsigned int canonicalSize (const unsigned int*);
00409 static unsigned int canonicalSize (const Int64*);
00410 static unsigned int canonicalSize (const uInt64*);
00411 static unsigned int canonicalSize (const float*);
00412 static unsigned int canonicalSize (const double*);
00413
00414
00415
00416
00417 static void reverse2 (void* to, const void* from);
00418
00419
00420 static void reverse4 (void* to, const void* from);
00421
00422
00423 static void reverse8 (void* to, const void* from);
00424
00425
00426 static void move2 (void* to, const void* from);
00427
00428
00429 static void move4 (void* to, const void* from);
00430
00431
00432 static void move8 (void* to, const void* from);
00433
00434 private:
00435
00436
00437 LECanonicalConversion();
00438 };
00439
00440
00441 inline void LECanonicalConversion::reverse2 (void* to, const void* from)
00442 {
00443 unsigned short x, xsw;
00444 memcpy(&x, from, 2);
00445 xsw = ((x & 0xffu) << 8u) | (x >> 8u);
00446 memcpy(to, &xsw, 2);
00447 }
00448
00449 inline void LECanonicalConversion::reverse4 (void* to, const void* from)
00450 {
00451 unsigned int x, xsw;
00452 memcpy(&x, from, 4);
00453 #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
00454 xsw = __builtin_bswap32(x);
00455 #else
00456 xsw = ((x & 0xffu) << 24u) | ((x & 0xff00u) << 8u) |
00457 ((x & 0xff0000u) >> 8u) | (x >> 24u);
00458 #endif
00459 memcpy(to, &xsw, 4);
00460 }
00461
00462 inline void LECanonicalConversion::reverse8 (void* to, const void* from)
00463 {
00464 uInt64 x, xsw;
00465 memcpy(&x, from, 8);
00466 #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
00467 xsw = __builtin_bswap64(x);
00468 #else
00469 xsw = ((x & 0xffULL) << 56ULL) |
00470 ((x & 0xff00ULL) << 40ULL) |
00471 ((x & 0xff0000ULL) << 24ULL) |
00472 ((x & 0xff000000ULL) << 8ULL) |
00473 ((x & 0xff00000000ULL) >> 8ULL) |
00474 ((x & 0xff0000000000ULL) >> 24ULL) |
00475 ((x & 0xff000000000000ULL) >> 40ULL) |
00476 ( x >> 56ULL);
00477 #endif
00478 memcpy(to, &xsw, 8);
00479 }
00480
00481 inline void LECanonicalConversion::move2 (void* to, const void* from)
00482 {
00483 memcpy(to, from, 2);
00484 }
00485
00486 inline void LECanonicalConversion::move4 (void* to, const void* from)
00487 {
00488 memcpy(to, from, 4);
00489 }
00490
00491 inline void LECanonicalConversion::move8 (void* to, const void* from)
00492 {
00493
00494 if (sizeof(to) < 8) {
00495 memmove(to, from, 8);
00496 }
00497 else {
00498 memcpy(to, from, 8);
00499 }
00500 }
00501
00502
00503
00504 inline size_t LECanonicalConversion::toLocal (char& to,
00505 const void* from)
00506 {
00507 to = *(char*)from;
00508 return SIZE_LECAN_CHAR;
00509 }
00510
00511 inline size_t LECanonicalConversion::toLocal (unsigned char& to,
00512 const void* from)
00513 {
00514 to = *(unsigned char*)from;
00515 return SIZE_LECAN_UCHAR;
00516 }
00517
00518 inline size_t LECanonicalConversion::toLocal (short& to,
00519 const void* from)
00520 {
00521 if (sizeof(short) != 2) {
00522 if (((signed char*)from)[0] < 0) {
00523 to = -1;
00524 }else{
00525 to = 0;
00526 }
00527 }
00528 #if !defined(AIPS_LITTLE_ENDIAN)
00529 reverse2 (&to, from);
00530 #else
00531 move2 (((char*)&to)+sizeof(short)-2, from);
00532 #endif
00533 return SIZE_LECAN_SHORT;
00534 }
00535
00536 inline size_t LECanonicalConversion::toLocal (unsigned short& to,
00537 const void* from)
00538 {
00539 if (sizeof(unsigned short) != 2) {
00540 to = 0;
00541 }
00542 #if !defined(AIPS_LITTLE_ENDIAN)
00543 reverse2 (&to, from);
00544 #else
00545 move2 (((char*)&to)+sizeof(unsigned short)-2, from);
00546 #endif
00547 return SIZE_LECAN_USHORT;
00548 }
00549
00550 inline size_t LECanonicalConversion::toLocal (int& to,
00551 const void* from)
00552 {
00553 if (sizeof(int) != 4) {
00554 if (((signed char*)from)[0] < 0) {
00555 to = -1;
00556 }else{
00557 to = 0;
00558 }
00559 }
00560 #if !defined(AIPS_LITTLE_ENDIAN)
00561 reverse4 (&to, from);
00562 #else
00563 move4 (((char*)&to)+sizeof(int)-4, from);
00564 #endif
00565 return SIZE_LECAN_INT;
00566 }
00567
00568 inline size_t LECanonicalConversion::toLocal (unsigned int& to,
00569 const void* from)
00570 {
00571 if (sizeof(unsigned int) != 4) {
00572 to = 0;
00573 }
00574 #if !defined(AIPS_LITTLE_ENDIAN)
00575 reverse4 (&to, from);
00576 #else
00577 move4 (((char*)&to)+sizeof(unsigned int)-4, from);
00578 #endif
00579 return SIZE_LECAN_UINT;
00580 }
00581
00582 inline size_t LECanonicalConversion::toLocal (Int64& to,
00583 const void* from)
00584 {
00585 if (sizeof(Int64) != 8) {
00586 if (((signed char*)from)[0] < 0) {
00587 to = -1;
00588 }else{
00589 to = 0;
00590 }
00591 }
00592 #if !defined(AIPS_LITTLE_ENDIAN)
00593 reverse8 (&to, from);
00594 #else
00595 move8 (((char*)&to)+sizeof(Int64)-8, from);
00596 #endif
00597 return SIZE_LECAN_INT64;
00598 }
00599
00600 inline size_t LECanonicalConversion::toLocal (uInt64& to,
00601 const void* from)
00602 {
00603 if (sizeof(uInt64) != 8) {
00604 to = 0;
00605 }
00606 #if !defined(AIPS_LITTLE_ENDIAN)
00607 reverse8 (&to, from);
00608 #else
00609 move8 (((char*)&to)+sizeof(uInt64)-8, from);
00610 #endif
00611 return SIZE_LECAN_UINT64;
00612 }
00613
00614 inline size_t LECanonicalConversion::toLocal (float& to,
00615 const void* from)
00616 {
00617 #if !defined(AIPS_LITTLE_ENDIAN)
00618 reverse4 (((char*)&to)+sizeof(float)-4, from);
00619 #else
00620 move4 (&to, from);
00621 #endif
00622 return SIZE_LECAN_FLOAT;
00623 }
00624
00625 inline size_t LECanonicalConversion::toLocal (double& to,
00626 const void* from)
00627 {
00628 #if !defined(AIPS_LITTLE_ENDIAN)
00629 reverse8 (((char*)&to)+sizeof(double)-8, from);
00630 #else
00631 move8 (&to, from);
00632 #endif
00633 return SIZE_LECAN_DOUBLE;
00634 }
00635
00636
00637 inline size_t LECanonicalConversion::fromLocal (void* to,
00638 const char& from)
00639 {
00640 *(char*)to = from;
00641 return SIZE_LECAN_CHAR;
00642 }
00643 inline size_t LECanonicalConversion::fromLocal (void* to,
00644 const unsigned char& from)
00645 {
00646 *(unsigned char*)to = from;
00647 return SIZE_LECAN_UCHAR;
00648 }
00649
00650 inline size_t LECanonicalConversion::fromLocal (void* to,
00651 const short& from)
00652 {
00653 #if !defined(AIPS_LITTLE_ENDIAN)
00654 reverse2 (to, &from);
00655 #else
00656 move2 (to, ((char*)&from)+sizeof(short)-2);
00657 #endif
00658 return SIZE_LECAN_SHORT;
00659 }
00660
00661 inline size_t LECanonicalConversion::fromLocal (void* to,
00662 const unsigned short& from)
00663 {
00664 #if !defined(AIPS_LITTLE_ENDIAN)
00665 reverse2 (to, &from);
00666 #else
00667 move2 (to, ((char*)&from)+sizeof(unsigned short)-2);
00668 #endif
00669 return SIZE_LECAN_USHORT;
00670 }
00671
00672 inline size_t LECanonicalConversion::fromLocal (void* to,
00673 const int& from)
00674 {
00675 #if !defined(AIPS_LITTLE_ENDIAN)
00676 reverse4 (to, &from);
00677 #else
00678 move4 (to, ((char*)&from)+sizeof(int)-4);
00679 #endif
00680 return SIZE_LECAN_INT;
00681 }
00682
00683 inline size_t LECanonicalConversion::fromLocal (void* to,
00684 const unsigned int& from)
00685 {
00686 #if !defined(AIPS_LITTLE_ENDIAN)
00687 reverse4 (to, &from);
00688 #else
00689 move4 (to, ((char*)&from)+sizeof(unsigned int)-4);
00690 #endif
00691 return SIZE_LECAN_UINT;
00692 }
00693
00694 inline size_t LECanonicalConversion::fromLocal (void* to,
00695 const Int64& from)
00696 {
00697 #if !defined(AIPS_LITTLE_ENDIAN)
00698 reverse8 (to, &from);
00699 #else
00700 move8 (to, ((char*)&from)+sizeof(Int64)-8);
00701 #endif
00702 return SIZE_LECAN_INT64;
00703 }
00704
00705 inline size_t LECanonicalConversion::fromLocal (void* to,
00706 const uInt64& from)
00707 {
00708 #if !defined(AIPS_LITTLE_ENDIAN)
00709 reverse8 (to, &from);
00710 #else
00711 move8 (to, ((char*)&from)+sizeof(uInt64)-8);
00712 #endif
00713 return SIZE_LECAN_UINT64;
00714 }
00715
00716 inline size_t LECanonicalConversion::fromLocal (void* to,
00717 const float& from)
00718 {
00719 #if !defined(AIPS_LITTLE_ENDIAN)
00720 reverse4 (to, &from);
00721 #else
00722 move4 (to, &from);
00723 #endif
00724 return SIZE_LECAN_FLOAT;
00725 }
00726
00727 inline size_t LECanonicalConversion::fromLocal (void* to,
00728 const double& from)
00729 {
00730 #if !defined(AIPS_LITTLE_ENDIAN)
00731 reverse8 (to, &from);
00732 #else
00733 move8 (to, &from);
00734 #endif
00735 return SIZE_LECAN_FLOAT;
00736 }
00737
00738
00739 inline size_t LECanonicalConversion::toLocal (char* to,
00740 const void* from,
00741 size_t nr)
00742 {
00743 return toLocalChar (to, from, nr);
00744 }
00745 inline size_t LECanonicalConversion::toLocal (unsigned char* to,
00746 const void* from,
00747 size_t nr)
00748 {
00749 return toLocalUChar (to, from, nr);
00750 }
00751 inline size_t LECanonicalConversion::toLocal (short* to,
00752 const void* from,
00753 size_t nr)
00754 {
00755 return toLocalShort (to, from, nr);
00756 }
00757 inline size_t LECanonicalConversion::toLocal (unsigned short* to,
00758 const void* from,
00759 size_t nr)
00760 {
00761 return toLocalUShort (to, from, nr);
00762 }
00763 inline size_t LECanonicalConversion::toLocal (int* to,
00764 const void* from,
00765 size_t nr)
00766 {
00767 return toLocalInt (to, from, nr);
00768 }
00769 inline size_t LECanonicalConversion::toLocal (unsigned int* to,
00770 const void* from,
00771 size_t nr)
00772 {
00773 return toLocalUInt (to, from, nr);
00774 }
00775 inline size_t LECanonicalConversion::toLocal (Int64* to,
00776 const void* from,
00777 size_t nr)
00778 {
00779 return toLocalInt64 (to, from, nr);
00780 }
00781 inline size_t LECanonicalConversion::toLocal (uInt64* to,
00782 const void* from,
00783 size_t nr)
00784 {
00785 return toLocalUInt64 (to, from, nr);
00786 }
00787 inline size_t LECanonicalConversion::toLocal (float* to,
00788 const void* from,
00789 size_t nr)
00790 {
00791 return toLocalFloat (to, from, nr);
00792 }
00793 inline size_t LECanonicalConversion::toLocal (double* to,
00794 const void* from,
00795 size_t nr)
00796 {
00797 return toLocalDouble (to, from, nr);
00798 }
00799
00800 inline size_t LECanonicalConversion::fromLocal (void* to,
00801 const char* from,
00802 size_t nr)
00803 {
00804 return fromLocalChar (to, from, nr);
00805 }
00806 inline size_t LECanonicalConversion::fromLocal (void* to,
00807 const unsigned char* from,
00808 size_t nr)
00809 {
00810 return fromLocalUChar (to, from, nr);
00811 }
00812 inline size_t LECanonicalConversion::fromLocal (void* to,
00813 const short* from,
00814 size_t nr)
00815 {
00816 return fromLocalShort (to, from, nr);
00817 }
00818 inline size_t LECanonicalConversion::fromLocal (void* to,
00819 const unsigned short* from,
00820 size_t nr)
00821 {
00822 return fromLocalUShort (to, from, nr);
00823 }
00824 inline size_t LECanonicalConversion::fromLocal (void* to,
00825 const int* from,
00826 size_t nr)
00827 {
00828 return fromLocalInt (to, from, nr);
00829 }
00830 inline size_t LECanonicalConversion::fromLocal (void* to,
00831 const unsigned int* from,
00832 size_t nr)
00833 {
00834 return fromLocalUInt (to, from, nr);
00835 }
00836 inline size_t LECanonicalConversion::fromLocal (void* to,
00837 const Int64* from,
00838 size_t nr)
00839 {
00840 return fromLocalInt64 (to, from, nr);
00841 }
00842 inline size_t LECanonicalConversion::fromLocal (void* to,
00843 const uInt64* from,
00844 size_t nr)
00845 {
00846 return fromLocalUInt64 (to, from, nr);
00847 }
00848 inline size_t LECanonicalConversion::fromLocal (void* to,
00849 const float* from,
00850 size_t nr)
00851 {
00852 return fromLocalFloat (to, from, nr);
00853 }
00854 inline size_t LECanonicalConversion::fromLocal (void* to,
00855 const double* from,
00856 size_t nr)
00857 {
00858 return fromLocalDouble (to, from, nr);
00859 }
00860
00861
00862 inline Conversion::ValueFunction* LECanonicalConversion::getToLocal
00863 (const char*)
00864 {
00865 return toLocalChar;
00866 }
00867 inline Conversion::ValueFunction* LECanonicalConversion::getToLocal
00868 (const unsigned char*)
00869 {
00870 return toLocalUChar;
00871 }
00872 inline Conversion::ValueFunction* LECanonicalConversion::getToLocal
00873 (const short*)
00874 {
00875 return toLocalShort;
00876 }
00877 inline Conversion::ValueFunction* LECanonicalConversion::getToLocal
00878 (const unsigned short*)
00879 {
00880 return toLocalUShort;
00881 }
00882 inline Conversion::ValueFunction* LECanonicalConversion::getToLocal
00883 (const int*)
00884 {
00885 return toLocalInt;
00886 }
00887 inline Conversion::ValueFunction* LECanonicalConversion::getToLocal
00888 (const unsigned int*)
00889 {
00890 return toLocalUInt;
00891 }
00892 inline Conversion::ValueFunction* LECanonicalConversion::getToLocal
00893 (const Int64*)
00894 {
00895 return toLocalInt64;
00896 }
00897 inline Conversion::ValueFunction* LECanonicalConversion::getToLocal
00898 (const uInt64*)
00899 {
00900 return toLocalUInt64;
00901 }
00902 inline Conversion::ValueFunction* LECanonicalConversion::getToLocal
00903 (const float*)
00904 {
00905 return toLocalFloat;
00906 }
00907 inline Conversion::ValueFunction* LECanonicalConversion::getToLocal
00908 (const double*)
00909 {
00910 return toLocalDouble;
00911 }
00912
00913 inline Conversion::ValueFunction* LECanonicalConversion::getFromLocal
00914 (const char*)
00915 {
00916 return fromLocalChar;
00917 }
00918 inline Conversion::ValueFunction* LECanonicalConversion::getFromLocal
00919 (const unsigned char*)
00920 {
00921 return fromLocalUChar;
00922 }
00923 inline Conversion::ValueFunction* LECanonicalConversion::getFromLocal
00924 (const short*)
00925 {
00926 return fromLocalShort;
00927 }
00928 inline Conversion::ValueFunction* LECanonicalConversion::getFromLocal
00929 (const unsigned short*)
00930 {
00931 return fromLocalUShort;
00932 }
00933 inline Conversion::ValueFunction* LECanonicalConversion::getFromLocal
00934 (const int*)
00935 {
00936 return fromLocalInt;
00937 }
00938 inline Conversion::ValueFunction* LECanonicalConversion::getFromLocal
00939 (const unsigned int*)
00940 {
00941 return fromLocalUInt;
00942 }
00943 inline Conversion::ValueFunction* LECanonicalConversion::getFromLocal
00944 (const Int64*)
00945 {
00946 return fromLocalInt64;
00947 }
00948 inline Conversion::ValueFunction* LECanonicalConversion::getFromLocal
00949 (const uInt64*)
00950 {
00951 return fromLocalUInt64;
00952 }
00953 inline Conversion::ValueFunction* LECanonicalConversion::getFromLocal
00954 (const float*)
00955 {
00956 return fromLocalFloat;
00957 }
00958 inline Conversion::ValueFunction* LECanonicalConversion::getFromLocal
00959 (const double*)
00960 {
00961 return fromLocalDouble;
00962 }
00963
00964
00965 inline unsigned int LECanonicalConversion::canonicalSize (const char*)
00966 {return SIZE_LECAN_CHAR;}
00967 inline unsigned int LECanonicalConversion::canonicalSize (const unsigned char*)
00968 {return SIZE_LECAN_UCHAR;}
00969 inline unsigned int LECanonicalConversion::canonicalSize (const short*)
00970 {return SIZE_LECAN_SHORT;}
00971 inline unsigned int LECanonicalConversion::canonicalSize (const unsigned short*)
00972 {return SIZE_LECAN_USHORT;}
00973 inline unsigned int LECanonicalConversion::canonicalSize (const int*)
00974 {return SIZE_LECAN_INT;}
00975 inline unsigned int LECanonicalConversion::canonicalSize (const unsigned int*)
00976 {return SIZE_LECAN_UINT;}
00977 inline unsigned int LECanonicalConversion::canonicalSize (const Int64*)
00978 {return SIZE_LECAN_INT64;}
00979 inline unsigned int LECanonicalConversion::canonicalSize (const uInt64*)
00980 {return SIZE_LECAN_UINT64;}
00981 inline unsigned int LECanonicalConversion::canonicalSize (const float*)
00982 {return SIZE_LECAN_FLOAT;}
00983 inline unsigned int LECanonicalConversion::canonicalSize (const double*)
00984 {return SIZE_LECAN_DOUBLE;}
00985
00986
00987
00988
00989
00990
00991 }
00992
00993 #endif