1#ifndef SERIALIZATION_BUFFER_HPP_KWLZAXD3
2#define SERIALIZATION_BUFFER_HPP_KWLZAXD3
4#include <vanetza/common/byte_buffer.hpp>
5#include <vanetza/common/byte_buffer_sink.hpp>
6#include <vanetza/common/byte_buffer_source.hpp>
7#include <vanetza/common/serialization.hpp>
8#include <boost/iostreams/stream_buffer.hpp>
14void serialize_into_buffer(
const T& t, ByteBuffer& buf)
16 byte_buffer_sink sink(buf);
17 boost::iostreams::stream_buffer<byte_buffer_sink> stream(sink);
18 OutputArchive ar(stream);
23void deserialize_from_buffer(T& t,
const ByteBuffer& buf)
25 byte_buffer_source source(buf);
26 boost::iostreams::stream_buffer<byte_buffer_source> stream(source);
27 InputArchive ar(stream);
32void deserialize_from_range(T& t,
typename byte_buffer_source::range range)
34 byte_buffer_source source(range);
35 boost::iostreams::stream_buffer<byte_buffer_source> stream(source);
36 InputArchive ar(stream);