8 #ifndef __NTV2NUBTYPES_H 9 #define __NTV2NUBTYPES_H 14 #if !defined(NTV2_DEPRECATE_16_3) 17 #endif // !defined(NTV2_DEPRECATE_16_3) 28 inArr.push_back(inVal);
31 inline void PUSHU16(
const uint16_t inVal,
RPCBlob & inArr,
const bool dontSwap =
false)
34 const UByte * _pU16 (reinterpret_cast<const UByte*>(&_u16));
35 inArr.push_back(_pU16[0]); inArr.push_back(_pU16[1]);
38 inline void PUSHU32(
const uint32_t inVal,
RPCBlob & inArr,
const bool dontSwap =
false)
41 const UByte * _pU32 (reinterpret_cast<const UByte*>(&_u32));
42 inArr.push_back(_pU32[0]); inArr.push_back(_pU32[1]);
43 inArr.push_back(_pU32[2]); inArr.push_back(_pU32[3]);
46 inline void PUSHU64(
const uint64_t inVal,
RPCBlob & inArr,
const bool dontSwap =
false)
49 const UByte * _pU64 (reinterpret_cast<const UByte*>(&_u64));
50 inArr.push_back(_pU64[0]); inArr.push_back(_pU64[1]);
51 inArr.push_back(_pU64[2]); inArr.push_back(_pU64[3]);
52 inArr.push_back(_pU64[4]); inArr.push_back(_pU64[5]);
53 inArr.push_back(_pU64[6]); inArr.push_back(_pU64[7]);
56 inline void POPU8 (uint8_t & outVal,
const RPCBlob & inArr, std::size_t & inOutNdx)
58 outVal = inArr.at(inOutNdx++);
61 inline void POPU16 (uint16_t & outVal,
const RPCBlob & inArr, std::size_t & inOutNdx,
const bool dontSwap =
false)
64 UByte * _pU8(reinterpret_cast<UByte*>(&_u16));
65 _pU8[0] = inArr.at(inOutNdx++); _pU8[1] = inArr.at(inOutNdx++);
69 inline void POPU32 (uint32_t & outVal,
const RPCBlob & inArr, std::size_t & inOutNdx,
const bool dontSwap =
false)
72 UByte * _pU8(reinterpret_cast<UByte*>(&_u32));
73 _pU8[0] = inArr.at(inOutNdx++); _pU8[1] = inArr.at(inOutNdx++);
74 _pU8[2] = inArr.at(inOutNdx++); _pU8[3] = inArr.at(inOutNdx++);
78 inline void POPU64 (uint64_t & outVal,
const RPCBlob & inArr, std::size_t & inOutNdx,
const bool dontSwap =
false)
81 UByte * _pU8(reinterpret_cast<UByte*>(&_u64));
82 _pU8[0] = inArr.at(inOutNdx++); _pU8[1] = inArr.at(inOutNdx++);
83 _pU8[2] = inArr.at(inOutNdx++); _pU8[3] = inArr.at(inOutNdx++);
84 _pU8[4] = inArr.at(inOutNdx++); _pU8[5] = inArr.at(inOutNdx++);
85 _pU8[6] = inArr.at(inOutNdx++); _pU8[7] = inArr.at(inOutNdx++);
91 #endif // __NTV2NUBTYPES_H void POPU16(uint16_t &outVal, const RPCBlob &inArr, std::size_t &inOutNdx, const bool dontSwap=false)
void PUSHU16(const uint16_t inVal, RPCBlob &inArr, const bool dontSwap=false)
#define NTV2HostIsBigEndian
#define NTV2EndianSwap32BtoH(__val__)
void PUSHU8(const uint8_t inVal, RPCBlob &inArr)
void POPU8(uint8_t &outVal, const RPCBlob &inArr, std::size_t &inOutNdx)
Defines a number of handy byte-swapping macros.
ULWord NTV2NubProtocolVersion
const bool kDisableByteSwap(true)
void POPU64(uint64_t &outVal, const RPCBlob &inArr, std::size_t &inOutNdx, const bool dontSwap=false)
#define NTV2EndianSwap64HtoB(__val__)
#define NTV2EndianSwap64BtoH(__val__)
#define NTV2EndianSwap32HtoB(__val__)
#define NTV2EndianSwap16BtoH(__val__)
const bool kEnableByteSwapIfNeeded(false)
void PUSHU32(const uint32_t inVal, RPCBlob &inArr, const bool dontSwap=false)
void PUSHU64(const uint64_t inVal, RPCBlob &inArr, const bool dontSwap=false)
std::vector< uint8_t > RPCBlob
#define NTV2EndianSwap16HtoB(__val__)
void POPU32(uint32_t &outVal, const RPCBlob &inArr, std::size_t &inOutNdx, const bool dontSwap=false)