JayBeams  0.1
Another project to have fun coding.
encoder.hpp
Go to the documentation of this file.
1 #ifndef jb_itch5_encoder_hpp
2 #define jb_itch5_encoder_hpp
3 
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 validate, 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
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.
TODO(#19) all this code should be replaced with Boost.Endian.
Definition: encoder.hpp:13
The top-level namespace for the JayBeams library.
Definition: as_hhmmss.hpp:7