JayBeams
0.1
Another project to have fun coding.
jb
itch5
encoder.hpp
Go to the documentation of this file.
1
#ifndef jb_itch5_encoder_hpp
2
#define jb_itch5_encoder_hpp
3
4
#include <
jb/itch5/check_offset.hpp
>
5
6
namespace
jb
{
7
namespace
itch5 {
8
9
/**
10
* TODO(#19) all this code should be replaced with Boost.Endian.
11
*/
12
template
<
bool
val
id
ate,
typename
T>
13
struct
encoder
{
14
/**
15
* Write a single message or field to a buffer.
16
*
17
* @param size the size of the message
18
* @param msg the contents of the message
19
* @param offset where in the message to start encoding
20
* @param x the value to encode
21
*
22
* @throws std::runtime_error if the buffer cannot hold the message.
23
*/
24
static
void
w
(std::size_t
size
,
void
* msg, std::size_t offset, T
const
& x);
25
};
26
27
}
// namespace itch5
28
}
// namespace jb
29
30
#endif // jb_itch5_encoder_hpp
jb::testing::defaults::size
int size
Definition:
microbenchmark_config.cpp:51
jb::itch5::encoder::w
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.
check_offset.hpp
jb::itch5::encoder
TODO(#19) all this code should be replaced with Boost.Endian.
Definition:
encoder.hpp:13
jb
The top-level namespace for the JayBeams library.
Definition:
as_hhmmss.hpp:7
Generated by
1.8.13