Vanetza
 
Loading...
Searching...
No Matches
byte_buffer_sink.hpp
1#ifndef BYTE_BUFFER_SINK_HPP_XQSBHPDQ
2#define BYTE_BUFFER_SINK_HPP_XQSBHPDQ
3
4#include <vanetza/common/byte_buffer.hpp>
5#include <boost/iostreams/categories.hpp>
6#include <ios>
7
8namespace vanetza
9{
10
12{
13public:
14 typedef char char_type;
15 typedef boost::iostreams::sink_tag category;
16 static_assert(sizeof(char_type) == sizeof(ByteBuffer::value_type),
17 "size mismatch of char_type and ByteBuffer::value_type");
18
19 byte_buffer_sink(ByteBuffer& buffer);
20 std::streamsize write(const char_type* s, std::streamsize n);
21
22private:
23 ByteBuffer& m_buffer;
24};
25
26} // namespace vanetza
27
28#endif /* BYTE_BUFFER_SINK_HPP_XQSBHPDQ */
29