00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 INLINE NativeNumericData::
00023 NativeNumericData(const void *data, size_t) :
00024 _source(data)
00025 {
00026 }
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041 INLINE NativeNumericData::
00042 NativeNumericData(const void *data, size_t start, size_t) {
00043 _source = (void *)((const char *)data + start);
00044 }
00045
00046
00047
00048
00049
00050
00051
00052
00053 INLINE void NativeNumericData::
00054 store_value(void *dest, size_t length) const {
00055 memcpy(dest, _source, length);
00056 }
00057
00058
00059
00060
00061
00062
00063
00064 INLINE const void *NativeNumericData::
00065 get_data() const {
00066 return _source;
00067 }
00068
00069
00070
00071
00072
00073 inline void TS_SetVal1(const PN_int8 * src, PN_int8 *dst)
00074 {
00075 *dst = *src;
00076 }
00077 inline void TS_SetVal2(const char * src, char *dst)
00078 {
00079 *(reinterpret_cast<PN_int16 *>(dst)) = *(reinterpret_cast <const PN_int16 *>(src));
00080 }
00081
00082 inline void TS_SetVal4(const char * src, char *dst)
00083 {
00084 *(reinterpret_cast <PN_int32 *>(dst)) = *(reinterpret_cast <const PN_int32 *>(src));
00085 }
00086
00087
00088 inline void TS_SetVal8(const char * src, char *dst)
00089 {
00090 *(reinterpret_cast<PN_int64 *>(dst)) = *(reinterpret_cast<const PN_int64 *>(src));
00091 }
00092
00093 template<class type> inline type TS_GetInteger(type &val,const char * _src)
00094 {
00095 val = *(reinterpret_cast <const type *>(_src));
00096 return val;
00097 }
00098
00099 template<class type> inline type TS_GetIntegerIncPtr(type &val,char *& _src)
00100 {
00101 val = *(reinterpret_cast <const type *>(_src));
00102 _src+= sizeof(type);
00103 return val;
00104 }
00105
00106 template<class type> inline void TS_AddIntegerIncPtr(type val, char *& _dst)
00107 {
00108 *(reinterpret_cast <type *>(_dst)) = val;
00109 _dst+= sizeof(type);
00110 }
00111
00112 template<class type> inline void TS_AddInteger(type val, char * _dst)
00113 {
00114 *(reinterpret_cast <type *>(_dst)) = val;
00115 }
00116
00117 #define TS_GetDirect(TT,SS) *((TT *)(SS))
00118 #define TS_GetDirectIncPtr(TT,SS) { _ptr += sizeof(TT); return *((TT *)(SS -sizeof(TT))); }
00119