hpx/serialization/input_archive.hpp#

Defined in header hpx/serialization/input_archive.hpp.

See Public API for a list of names and headers that are part of the public HPX API.

namespace hpx
namespace serialization
struct input_archive : public basic_archive<input_archive>#

Public Types

using base_type = basic_archive<input_archive>#

Public Functions

template<typename Container>
inline explicit input_archive(Container &buffer, std::size_t inbound_data_size = 0, std::vector<serialization_chunk> *chunks = nullptr)#
template<typename T>
inline void invoke(T &t)#
template<typename T>
inline void invoke_impl(T &t)#
template<typename T>
inline void load(T &t)#
inline void load(float &f)#
inline void load(double &d)#
inline void load(long double &d)#
inline void load(char &c)#
inline void load(signed char &c)#
inline void load(unsigned char &c)#
inline void load(bool &b)#
inline std::size_t get_zero_copy_serialization_threshold() const noexcept#
inline constexpr std::size_t bytes_read() const noexcept#
inline constexpr bool is_filtered() const noexcept#
inline constexpr std::size_t current_pos() const noexcept#
inline void load_binary(detail::fundamental_types expected, void *address, std::size_t const count)#
inline void load_binary_chunk(detail::fundamental_types expected, void *address, std::size_t const count, bool const allow_zero_copy_receive, chunk_memory const memory = chunk_memory::host)#

Reads count bytes written by save_binary_chunk into the memory at address.

With allow_zero_copy_receive (and an archive whose chunks the networking layer fills in after de-serialization, see serialization::detail::allow_zero_copy_receive), nothing is copied here: the chunk is pointed at address, and the networking layer places the data there only after this function (and the load() that calls it) has returned. The memory at address must stay valid until then and must not be read before. A load() that uses the data (or that can’t receive it into its final place, e.g. device memory) receives it into a staging buffer instead and registers the step that completes the object with serialization::detail::post_receive_actions: a parcel runs these steps once its data has arrived, and its action only after the last of them has finished. Without allow_zero_copy_receive (and for data below the zero-copy threshold, which isn’t sent as a chunk) the data is complete when this function returns.

Parameters:
  • expected – The type of the data, checked by archives with type checking.

  • address – Where the data goes.

  • count – The number of bytes.

  • allow_zero_copy_receive – Whether the data may arrive at address after this function has returned.

  • memory – Whether address refers to device memory: the networking layer receives into it then (see serialization_chunk::is_device_memory).

Private Members

std::unique_ptr<erased_input_container> buffer_#
bool filtered_ = false#

Friends

friend struct basic_archive< input_archive >