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