8 #ifndef __NTV2NUBTYPES_H
9 #define __NTV2NUBTYPES_H
14 #define NTV2NUBPORT 7575 // Default port we listen on
16 #if !defined(NTV2_DEPRECATE_16_3)
19 #endif // !defined(NTV2_DEPRECATE_16_3)
26 inline void PUSHU8(
const uint8_t inVal, std::vector<uint8_t> & inArr)
28 inArr.push_back(inVal);
31 inline void PUSHU16(
const uint16_t inVal, std::vector<uint8_t> & 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, std::vector<uint8_t> & 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, std::vector<uint8_t> & 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 std::vector<uint8_t> & inArr, std::size_t & inOutNdx)
58 outVal = inArr.at(inOutNdx++);
61 inline void POPU16 (uint16_t & outVal,
const std::vector<uint8_t> & inArr, std::size_t & inOutNdx,
const bool dontSwap =
false)
65 _pU8[0] = inArr.at(inOutNdx++); _pU8[1] = inArr.at(inOutNdx++);
69 inline void POPU32 (uint32_t & outVal,
const std::vector<uint8_t> & inArr, std::size_t & inOutNdx,
const bool dontSwap =
false)
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 std::vector<uint8_t> & inArr, std::size_t & inOutNdx,
const bool dontSwap =
false)
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