6#include <bond/core/config.h>
13template <
typename T, u
int32_t N>
14struct VariableUnsigned
16 static void Write(uint32_t& count, T value)
18 BOOST_STATIC_ASSERT(N < 10);
21 VariableUnsigned<T, N+1>::Write(count, value >> 7);
28struct VariableUnsigned<uint64_t, 10>
30 static void Write(uint32_t& count, uint64_t )
37struct VariableUnsigned<uint32_t, 5>
39 static void Write(uint32_t& count, uint32_t )
46struct VariableUnsigned<uint16_t, 3>
48 static void Write(uint32_t& count, uint16_t )
72 uint32_t GetCount()
const
83 void Write(
const void*, uint32_t size)
88 void Write(
const blob& buffer)
90 _count += buffer.size();
93 void Write(
const Buffer& buffer)
95 _count += buffer.size();
99 void WriteVariableUnsigned(T value)
101 VariableUnsigned<T, 1>::Write(_count, value >> 7);
104 Buffer GetBuffer()
const
106 return { GetCount() };
114inline OutputCounter CreateOutputBuffer(
const OutputCounter& )
116 return OutputCounter();
namespace bond
Definition: apply.h:17