1 #ifndef jb_itch5_base_encoders_hpp 2 #define jb_itch5_base_encoders_hpp 12 template <
bool val
idate>
15 w(std::size_t
size,
void* msg, std::size_t offset, std::uint8_t x) {
16 check_offset<validate>(
"encode std::uint8_t",
size, offset, 1);
17 static_cast<std::uint8_t*
>(msg)[offset] = x;
22 template <
bool val
idate>
26 w(std::size_t
size,
void* msg, std::size_t offset, std::uint16_t x) {
27 check_offset<validate>(
"encode std::uint16_t",
size, offset, 2);
30 size, msg, offset + 1, std::uint8_t(x & 0xff));
35 template <
bool val
idate>
39 w(std::size_t
size,
void* msg, std::size_t offset, std::uint32_t x) {
40 check_offset<validate>(
"encode std::uint32_t",
size, offset, 4);
43 size, msg, offset + 2, std::uint16_t(x & 0xffff));
48 template <
bool val
idate>
52 w(std::size_t
size,
void* msg, std::size_t offset, std::uint64_t x) {
53 check_offset<validate>(
"encode std::uint32_t",
size, offset, 8);
56 size, msg, offset + 4, std::uint32_t(x & 0xffffffff));
63 #endif // jb_itch5_base_encoders_hpp
static void w(std::size_t size, void *msg, std::size_t offset, T const &x)
Write a single message or field to a buffer.
static void w(std::size_t size, void *msg, std::size_t offset, std::uint8_t x)
static void w(std::size_t size, void *msg, std::size_t offset, std::uint16_t x)
Please see the generic documentation for jb::itch5::encoder<>::w()
TODO(#19) all this code should be replaced with Boost.Endian.
static void w(std::size_t size, void *msg, std::size_t offset, std::uint64_t x)
Please see the generic documentation for jb::itch5::encoder<>::w()
static void w(std::size_t size, void *msg, std::size_t offset, std::uint32_t x)
Please see the generic documentation for jb::itch5::encoder<>::w()
The top-level namespace for the JayBeams library.