23#ifndef GOBY_MIDDLEWARE_MARSHALLING_BOOST_SERIALIZATION_H
24#define GOBY_MIDDLEWARE_MARSHALLING_BOOST_SERIALIZATION_H
26#include <boost/archive/binary_iarchive.hpp>
27#include <boost/archive/binary_oarchive.hpp>
28#include <boost/iostreams/device/back_inserter.hpp>
29#include <boost/iostreams/stream.hpp>
30#include <boost/serialization/shared_ptr.hpp>
31#include <boost/serialization/string.hpp>
32#include <boost/serialization/vector.hpp>
36#include "goby/middleware/marshalling/interface.h"
50 return T::goby_boost_serialization_type;
57 std::vector<char> data;
58 boost::iostreams::back_insert_device<std::vector<char>> inserter(data);
59 boost::iostreams::stream<boost::iostreams::back_insert_device<std::vector<char>>> stream(
61 boost::archive::binary_oarchive oa(stream);
70 template <
typename CharIterator>
74 std::shared_ptr<T>
t = std::make_shared<T>();
77 boost::iostreams::stream<boost::iostreams::basic_array_source<char>>
stream(
device);
78 boost::archive::binary_iarchive
ia(
stream);
88 typename std::enable_if<T::goby_boost_serialization_type != nullptr>::type* =
nullptr>
101namespace serialization
104template <
class Archive>
112template <
class Archive>
130 return "TaggedAudioBuffer";
void serialize(Archive &ar, netsim::AudioBuffer &b, const unsigned int version)
constexpr int BOOST_SERIALIZATION_SCHEME
constexpr const char * boost_serialization_type_name()
constexpr const char * boost_serialization_type_name< netsim::TaggedAudioBuffer >()
static std::string type_name(const T &t=T())
static std::vector< char > serialize(const T &msg)
static std::shared_ptr< T > parse(CharIterator bytes_begin, CharIterator bytes_end, CharIterator &actual_end, const std::string &type=type_name())
jack_nframes_t jack_frame_time
std::vector< netsim::sample_t > samples
std::shared_ptr< const AudioBuffer > buffer