archive.h
Go to the documentation of this file.
59 "iarchive_load_override_optimized_dispatch does not support serialization of polymorphic types");
97 using base_type = boost::archive::binary_oarchive_impl<boost_optimized_oarchive<StreamOrStreambuf>,
99 // if pbase_type is derived from std::streambuf can use this information to avoid virtual function calls and inline
100 static constexpr bool pbase_derived_from_stdstreambuf = std::is_base_of_v<std::streambuf, pbase_type>;
114 : pbase_type{}, base_type(this->pbase(), boost::archive::no_header | boost::archive::no_codecvt){};
143 void save_object(const void* x, const boost::archive::detail::basic_oserializer& bos) { abort(); }
172 if constexpr (pbase_derived_from_stdstreambuf) { // if we were given a streambuf use it directly ...
230 inline auto make_boost_buffer_oarchive(void* const buf, std::size_t size, std::size_t buf_offset = 0) {
232 return ttg::detail::boost_byte_oarchive(ttg::detail::byte_ostreambuf(static_cast<char*>(buf) + buf_offset, size - buf_offset));
244 return ttg::detail::boost_byte_oarchive(ttg::detail::byte_ostreambuf(&(buf[buf_offset], N - buf_offset)));
255 using base_type = boost::archive::binary_iarchive_impl<boost_optimized_iarchive, std::ostream::char_type,
257 // if pbase_type is derived from std::streambuf can use this information to avoid virtual function calls and inline
258 static constexpr bool pbase_derived_from_stdstreambuf = std::is_base_of_v<std::streambuf, pbase_type>;
272 : pbase_type{}, base_type(this->pbase(), boost::archive::no_header | boost::archive::no_codecvt){};
336 if constexpr (pbase_derived_from_stdstreambuf) { // if we were given a streambuf use it directly ...
340 std::streamsize scount = static_cast<StreamOrStreambuf&>(this->pbase()).sgetn(static_cast<Elem*>(address), s);
390 inline auto make_boost_buffer_iarchive(const void* const buf, std::size_t size, std::size_t buf_offset = 0) {
392 return ttg::detail::boost_byte_iarchive(ttg::detail::byte_istreambuf(static_cast<const char*>(buf) + buf_offset, size - buf_offset));
404 return ttg::detail::boost_byte_iarchive(ttg::detail::byte_istreambuf((&(buf[buf_offset]), N - buf_offset)));
409 // for some reason need to use array optimization for the base as well ... dispatch to optimized version in
410 // array_wrapper.hpp:serializer(ar,version) for some reason uses Archive::base_type using apple clang 12.0.5.12050022
416 BOOST_SERIALIZATION_USE_ARRAY_OPTIMIZATION_FOR_THIS_AND_BASE(ttg::detail::boost_counting_oarchive);
418 BOOST_SERIALIZATION_USE_ARRAY_OPTIMIZATION_FOR_THIS_AND_BASE(ttg::detail::boost_iovec_oarchive);
420 BOOST_SERIALIZATION_USE_ARRAY_OPTIMIZATION_FOR_THIS_AND_BASE(ttg::detail::boost_buffer_oarchive);
422 BOOST_SERIALIZATION_USE_ARRAY_OPTIMIZATION_FOR_THIS_AND_BASE(ttg::detail::boost_iovec_iarchive);
424 BOOST_SERIALIZATION_USE_ARRAY_OPTIMIZATION_FOR_THIS_AND_BASE(ttg::detail::boost_buffer_iarchive);
BOOST_SERIALIZATION_REGISTER_ARCHIVE(ttg::detail::boost_counting_oarchive)
#define BOOST_SERIALIZATION_USE_ARRAY_OPTIMIZATION_FOR_THIS_AND_BASE(x)
Definition: archive.h:411
optimized data-only deserializer for boost_optimized_oarchive
Definition: archive.h:252
void load_override(boost::archive::class_id_type &t)
Definition: archive.h:296
void load_binary(void *address, std::size_t count)
Definition: archive.h:332
boost::archive::binary_iarchive_impl< boost_optimized_iarchive, std::ostream::char_type, std::ostream::traits_type > base_type
Definition: archive.h:256
StreamOrStreambuf pbase_type
Definition: archive.h:254
void load_override(T &t)
Definition: archive.h:287
void load_override(boost::archive::version_type &t)
Definition: archive.h:293
void load_array(boost::serialization::array_wrapper< ValueType > &a, unsigned int)
Definition: archive.h:327
boost_optimized_iarchive(StreamOrStreambuf sbuf)
Definition: archive.h:274
void load_object(void *x, const boost::archive::detail::basic_oserializer &bos)
Definition: archive.h:301
boost_optimized_iarchive()
Definition: archive.h:271
void load_override(boost::serialization::item_version_type &t)
Definition: archive.h:294
void load_override(boost::archive::class_id_reference_type &t)
Definition: archive.h:297
friend class boost::archive::save_access
Definition: archive.h:261
void load_override(boost::archive::class_id_optional_type &)
Definition: archive.h:291
boost_optimized_iarchive(Arg &&arg)
Definition: archive.h:279
const auto & streambuf() const
Definition: archive.h:363
static constexpr bool pbase_derived_from_stdstreambuf
Definition: archive.h:258
const auto & streambuf() const
Definition: archive.h:200
auto & operator&(const T &t)
Definition: archive.h:196
void save_binary(const void *address, std::size_t count)
Definition: archive.h:171
void save_override(const boost::archive::version_type &t)
Definition: archive.h:135
StreamOrStreambuf pbase_type
Definition: archive.h:96
static constexpr bool pbase_derived_from_stdstreambuf
Definition: archive.h:100
void save_override(const boost::archive::class_id_reference_type &t)
Definition: archive.h:139
void save_override(const boost::serialization::item_version_type &t)
Definition: archive.h:136
void save_override(const T &t)
Definition: archive.h:129
boost_optimized_oarchive(Arg &&arg)
Definition: archive.h:121
void save_override(const boost::archive::class_id_type &t)
Definition: archive.h:138
void save_override(const boost::archive::class_id_optional_type &)
Definition: archive.h:133
boost_optimized_oarchive(StreamOrStreambuf sbuf)
Definition: archive.h:116
void save_object(const void *x, const boost::archive::detail::basic_oserializer &bos)
Definition: archive.h:143
friend class boost::archive::save_access
Definition: archive.h:103
boost::archive::binary_oarchive_impl< boost_optimized_oarchive< StreamOrStreambuf >, std::ostream::char_type, std::ostream::traits_type > base_type
Definition: archive.h:98
auto & operator<<(const T &t)
Definition: archive.h:189
void save_array(boost::serialization::array_wrapper< ValueType > const &a, unsigned int)
Definition: archive.h:166
boost_optimized_oarchive()
Definition: archive.h:113
streambuf that writes bytes to a buffer in memory
Definition: stream.h:101
streambuf that writes bytes to a buffer in memory
Definition: stream.h:71
Definition: add_member_const.hpp:14
Definition: keymap.h:9
void oarchive_save_override_optimized_dispatch(Archive &ar, const T &t)
Definition: archive.h:23
auto make_boost_buffer_iarchive(const void *const buf, std::size_t size, std::size_t buf_offset=0)
constructs a boost_buffer_iarchive object
Definition: archive.h:390
boost_optimized_oarchive< byte_ostreambuf > boost_byte_oarchive
an archive that constructs serialized representation of an object in a memory buffer,...
Definition: archive.h:222
auto make_boost_buffer_oarchive(void *const buf, std::size_t size, std::size_t buf_offset=0)
constructs a boost_buffer_oarchive object
Definition: archive.h:230
void iarchive_load_override_optimized_dispatch(Archive &ar, T &t)
Definition: archive.h:48
boost_optimized_iarchive< byte_istreambuf > boost_byte_iarchive
the deserializer for boost_byte_oarchive
Definition: archive.h:382
void abort()
Aborts the TTG program using the default backend's ttg_abort method.
Definition: run.h:62