24#ifndef GOBY_MIDDLEWARE_MARSHALLING_BOOST_SERIALIZATION_H
25#define GOBY_MIDDLEWARE_MARSHALLING_BOOST_SERIALIZATION_H
27#include <boost/archive/binary_iarchive.hpp>
28#include <boost/archive/binary_oarchive.hpp>
29#include <boost/iostreams/device/back_inserter.hpp>
30#include <boost/iostreams/stream.hpp>
31#include <boost/serialization/shared_ptr.hpp>
32#include <boost/serialization/string.hpp>
33#include <boost/serialization/vector.hpp>
37#include "goby/middleware/marshalling/interface.h"
51 return T::goby_boost_serialization_type;
58 std::vector<char> data;
59 boost::iostreams::back_insert_device<std::vector<char>> inserter(data);
60 boost::iostreams::stream<boost::iostreams::back_insert_device<std::vector<char>>> stream(
62 boost::archive::binary_oarchive oa(stream);
71 template <
typename CharIterator>
75 std::shared_ptr<T>
t = std::make_shared<T>();
78 boost::iostreams::stream<boost::iostreams::basic_array_source<char>>
stream(
device);
79 boost::archive::binary_iarchive
ia(
stream);
89 typename std::enable_if<T::goby_boost_serialization_type != nullptr>::type* =
nullptr>
102namespace serialization
105template <
class Archive>
113template <
class Archive>
131 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