8 #ifndef __NTV2NUBTYPES_H
9 #define __NTV2NUBTYPES_H
14 #if !defined(NTV2_DEPRECATE_16_3)
17 #endif // !defined(NTV2_DEPRECATE_16_3)
24 inline void PUSHU8(
const uint8_t inVal, std::vector<uint8_t> & inArr)
26 inArr.push_back(inVal);
29 inline void PUSHU16(
const uint16_t inVal, std::vector<uint8_t> & inArr,
const bool dontSwap =
false)
32 const UByte * _pU16 (
reinterpret_cast<const UByte*
>(&_u16));
33 inArr.push_back(_pU16[0]); inArr.push_back(_pU16[1]);
36 inline void PUSHU32(
const uint32_t inVal, std::vector<uint8_t> & inArr,
const bool dontSwap =
false)
39 const UByte * _pU32 (
reinterpret_cast<const UByte*
>(&_u32));
40 inArr.push_back(_pU32[0]); inArr.push_back(_pU32[1]);
41 inArr.push_back(_pU32[2]); inArr.push_back(_pU32[3]);
44 inline void PUSHU64(
const uint64_t inVal, std::vector<uint8_t> & inArr,
const bool dontSwap =
false)
47 const UByte * _pU64 (
reinterpret_cast<const UByte*
>(&_u64));
48 inArr.push_back(_pU64[0]); inArr.push_back(_pU64[1]);
49 inArr.push_back(_pU64[2]); inArr.push_back(_pU64[3]);
50 inArr.push_back(_pU64[4]); inArr.push_back(_pU64[5]);
51 inArr.push_back(_pU64[6]); inArr.push_back(_pU64[7]);
54 inline void POPU8 (uint8_t & outVal,
const std::vector<uint8_t> & inArr, std::size_t & inOutNdx)
56 outVal = inArr.at(inOutNdx++);
59 inline void POPU16 (uint16_t & outVal,
const std::vector<uint8_t> & inArr, std::size_t & inOutNdx,
const bool dontSwap =
false)
63 _pU8[0] = inArr.at(inOutNdx++); _pU8[1] = inArr.at(inOutNdx++);
67 inline void POPU32 (uint32_t & outVal,
const std::vector<uint8_t> & inArr, std::size_t & inOutNdx,
const bool dontSwap =
false)
71 _pU8[0] = inArr.at(inOutNdx++); _pU8[1] = inArr.at(inOutNdx++);
72 _pU8[2] = inArr.at(inOutNdx++); _pU8[3] = inArr.at(inOutNdx++);
76 inline void POPU64 (uint64_t & outVal,
const std::vector<uint8_t> & inArr, std::size_t & inOutNdx,
const bool dontSwap =
false)
80 _pU8[0] = inArr.at(inOutNdx++); _pU8[1] = inArr.at(inOutNdx++);
81 _pU8[2] = inArr.at(inOutNdx++); _pU8[3] = inArr.at(inOutNdx++);
82 _pU8[4] = inArr.at(inOutNdx++); _pU8[5] = inArr.at(inOutNdx++);
83 _pU8[6] = inArr.at(inOutNdx++); _pU8[7] = inArr.at(inOutNdx++);
89 #endif // __NTV2NUBTYPES_H