8 #ifndef __NTV2NUBTYPES_H 9 #define __NTV2NUBTYPES_H 14 #if !defined(NTV2_DEPRECATE_16_3) 17 #endif // !defined(NTV2_DEPRECATE_16_3) 49 inline void PUSHU16(
const uint16_t val,
RPCBlob & blob,
const bool dontSwap =
false)
52 const UByte * _pU16 (reinterpret_cast<const UByte*>(&_u16));
53 blob.push_back(_pU16[0]); blob.push_back(_pU16[1]);
63 inline void PUSHU32(
const uint32_t val,
RPCBlob & blob,
const bool dontSwap =
false)
66 const UByte * _pU32 (reinterpret_cast<const UByte*>(&_u32));
67 blob.push_back(_pU32[0]); blob.push_back(_pU32[1]);
68 blob.push_back(_pU32[2]); blob.push_back(_pU32[3]);
78 inline void PUSHU64(
const uint64_t val,
RPCBlob & blob,
const bool dontSwap =
false)
81 const UByte * _pU64 (reinterpret_cast<const UByte*>(&_u64));
82 blob.push_back(_pU64[0]); blob.push_back(_pU64[1]);
83 blob.push_back(_pU64[2]); blob.push_back(_pU64[3]);
84 blob.push_back(_pU64[4]); blob.push_back(_pU64[5]);
85 blob.push_back(_pU64[6]); blob.push_back(_pU64[7]);
90 #define NTV2_NUB_RGCHK(_cnt_) if (inOutNdx + (_cnt_) > blob.size()) \ 93 #define NTV2_NUB_RGCHK(_cnt_) 110 inline bool POPU8 (uint8_t & outVal,
const RPCBlob & blob, std::size_t & inOutNdx)
113 outVal = blob.at(inOutNdx++);
128 inline bool POPU16 (uint16_t & outVal,
const RPCBlob & blob, std::size_t & inOutNdx,
const bool dontSwap =
false)
131 UByte * _pU8(reinterpret_cast<UByte*>(&_u16));
133 _pU8[0] = blob.at(inOutNdx++); _pU8[1] = blob.at(inOutNdx++);
149 inline bool POPU32 (uint32_t & outVal,
const RPCBlob & blob, std::size_t & inOutNdx,
const bool dontSwap =
false)
152 UByte * _pU8(reinterpret_cast<UByte*>(&_u32));
154 _pU8[0] = blob.at(inOutNdx++); _pU8[1] = blob.at(inOutNdx++);
155 _pU8[2] = blob.at(inOutNdx++); _pU8[3] = blob.at(inOutNdx++);
171 inline bool POPU64 (uint64_t & outVal,
const RPCBlob & blob, std::size_t & inOutNdx,
const bool dontSwap =
false)
174 UByte * _pU8(reinterpret_cast<UByte*>(&_u64));
176 _pU8[0] = blob.at(inOutNdx++); _pU8[1] = blob.at(inOutNdx++);
177 _pU8[2] = blob.at(inOutNdx++); _pU8[3] = blob.at(inOutNdx++);
178 _pU8[4] = blob.at(inOutNdx++); _pU8[5] = blob.at(inOutNdx++);
179 _pU8[6] = blob.at(inOutNdx++); _pU8[7] = blob.at(inOutNdx++);
187 #endif // __NTV2NUBTYPES_H #define NTV2HostIsBigEndian
void PUSHU32(const uint32_t val, RPCBlob &blob, const bool dontSwap=false)
Pushes a 32-bit value onto the given byte sequence.
#define NTV2EndianSwap32BtoH(__val__)
Defines a number of handy byte-swapping macros.
bool POPU8(uint8_t &outVal, const RPCBlob &blob, std::size_t &inOutNdx)
Pops an 8-bit value off the given byte sequence at the given zero-based index position.
ULWord NTV2NubProtocolVersion
const bool kDisableByteSwap(true)
void PUSHU8(const uint8_t val, RPCBlob &blob)
Pushes an 8-bit value onto the given byte sequence.
#define NTV2EndianSwap64HtoB(__val__)
#define NTV2EndianSwap64BtoH(__val__)
void PUSHU16(const uint16_t val, RPCBlob &blob, const bool dontSwap=false)
Pushes a 16-bit value onto the given byte sequence.
#define NTV2EndianSwap32HtoB(__val__)
#define NTV2EndianSwap16BtoH(__val__)
const bool kEnableByteSwapIfNeeded(false)
std::vector< uint8_t > RPCBlob
#define NTV2EndianSwap16HtoB(__val__)
bool POPU32(uint32_t &outVal, const RPCBlob &blob, std::size_t &inOutNdx, const bool dontSwap=false)
Pops a 32-bit value off the given byte sequence at the given zero-based index position.
bool POPU64(uint64_t &outVal, const RPCBlob &blob, std::size_t &inOutNdx, const bool dontSwap=false)
Pops a 64-bit value off the given byte sequence at the given zero-based index position.
bool POPU16(uint16_t &outVal, const RPCBlob &blob, std::size_t &inOutNdx, const bool dontSwap=false)
Pops a 16-bit value off the given byte sequence at the given zero-based index position.
#define NTV2_NUB_RGCHK(_cnt_)
void PUSHU64(const uint64_t val, RPCBlob &blob, const bool dontSwap=false)
Pushes a 64-bit value onto the given byte sequence.