serialization¶
The contents of this module can be included with the header
hpx/modules/serialization.hpp
. These headers may be used by user-code but are not
guaranteed stable (neither header location nor contents). You are using these at
your own risk. If you wish to use non-public functionality from a module we
strongly suggest only including the module header hpx/modules/serialization.hpp
, not
the particular header in which the functionality you would like to use is
defined. See Public API for a list of names that are part of the public
HPX API.
-
template<typename
T
>
structserialize_non_intrusive
<T, typename std::enable_if<has_serialize_adl<T>::value>::type>¶
-
namespace
hpx
-
namespace
serialization
-
class
access
¶ Public Static Functions
-
template<class
T
>
classhas_serialize
¶ Public Static Attributes
-
constexpr bool
value
= decltype(test<T>(0))::value¶
-
constexpr bool
-
template<class
T
>
classserialize_dispatcher
¶ -
-
struct
empty
¶ Public Static Functions
-
template<class
Archive
>
static voidcall
(Archive&, T&, unsigned)¶
-
template<class
-
struct
intrusive_polymorphic
¶ Public Static Functions
-
template<>
static voidcall
(hpx::serialization::input_archive &ar, T &t, unsigned)¶
-
template<>
static voidcall
(hpx::serialization::output_archive &ar, T const &t, unsigned)¶
-
template<>
-
struct
-
template<class
-
class
-
namespace
-
namespace
hpx
-
namespace
serialization
Functions
-
template<typename
Archive
, typenameT
, std::size_tN
>
voidserialize
(Archive &ar, std::array<T, N> &a, const unsigned int)¶
-
template<typename
T
>
output_archive &operator<<
(output_archive &ar, array<T> t)¶
-
template<typename
T
>
input_archive &operator>>
(input_archive &ar, array<T> t)¶
-
template<typename
T
>
output_archive &operator&
(output_archive &ar, array<T> t)¶
-
template<typename
T
>
input_archive &operator&
(input_archive &ar, array<T> t)¶
-
template<typename
T
, std::size_tN
>
output_archive &operator<<
(output_archive &ar, T (&t)[N])¶
-
template<typename
T
, std::size_tN
>
input_archive &operator>>
(input_archive &ar, T (&t)[N])¶
-
template<typename
T
, std::size_tN
>
output_archive &operator&
(output_archive &ar, T (&t)[N])¶
-
template<typename
T
, std::size_tN
>
input_archive &operator&
(input_archive &ar, T (&t)[N])¶
-
template<class
T
>
classarray
¶ Public Types
-
template<>
usingvalue_type
= T¶
Public Functions
-
value_type *
address
() const¶
-
void
serialize_optimized
(output_archive &ar, unsigned int, std::true_type)¶
-
void
serialize_optimized
(input_archive &ar, unsigned int, std::true_type)¶
-
template<>
-
template<typename
-
namespace
-
template<typename
Derived
, typenameBase
>
structbase_object_type
<Derived, Base, std::true_type>¶ -
Public Members
-
Derived &
d_
¶
-
Derived &
-
namespace
hpx
-
namespace
serialization
Functions
-
template<typename
D
, typenameB
>
output_archive &operator<<
(output_archive &ar, base_object_type<D, B> t)¶
-
template<typename
D
, typenameB
>
input_archive &operator>>
(input_archive &ar, base_object_type<D, B> t)¶
-
template<typename
D
, typenameB
>
output_archive &operator&
(output_archive &ar, base_object_type<D, B> t)¶
-
template<typename
D
, typenameB
>
input_archive &operator&
(input_archive &ar, base_object_type<D, B> t)¶
-
template<typename
Derived
, typenameBase
, typenameEnable
= typename hpx::traits::is_intrusive_polymorphic<Derived>::type>
structbase_object_type
¶ Public Functions
-
base_object_type
(Derived &d)
Public Members
-
Derived &
d_
-
-
template<typename
Derived
, typenameBase
>
structbase_object_type
<Derived, Base, std::true_type> Public Functions
-
base_object_type
(Derived &d)
-
template<class
Archive
>
voidsave
(Archive &ar, unsigned) const
-
template<class
Archive
>
voidload
(Archive &ar, unsigned)
-
HPX_SERIALIZATION_SPLIT_MEMBER
()
Public Members
-
Derived &
d_
-
-
template<typename
-
namespace
-
namespace
hpx
-
namespace
serialization
Enums
Functions
-
template<typename
Archive
>
structbasic_archive
¶ Public Functions
-
virtual
~basic_archive
()¶
-
bool
enable_compression
() const¶
-
bool
endian_big
() const¶
-
bool
endian_little
() const¶
-
bool
disable_array_optimization
() const¶
-
bool
disable_data_chunking
() const¶
-
bool
is_preprocessing
() const¶
-
void
reset
()¶
Protected Functions
-
basic_archive
(basic_archive const&)¶
-
basic_archive &
operator=
(basic_archive const&)¶
-
virtual
-
template<typename
-
namespace
-
namespace
hpx
-
namespace
serialization
-
struct
binary_filter
¶
-
struct
-
namespace
-
namespace
hpx
-
namespace
serialization
Functions
-
template<std::size_t
N
>
voidserialize
(input_archive &ar, std::bitset<N> &d, unsigned)¶
-
template<std::size_t
N
>
voidserialize
(output_archive &ar, std::bitset<N> const &bs, unsigned)¶
-
template<std::size_t
-
namespace
-
namespace
hpx
-
namespace
serialization
Functions
-
template<typename
T
>
voidserialize
(input_archive &ar, std::complex<T> &c, unsigned)¶
-
template<typename
T
>
voidserialize
(output_archive &ar, std::complex<T> const &c, unsigned)¶
-
template<typename
-
namespace
-
namespace
hpx
-
namespace
serialization
-
struct
erased_input_container
¶ Subclassed by hpx::serialization::input_container< Container >
-
struct
erased_output_container
¶ Subclassed by hpx::serialization::output_container< Container, Chunker >
-
struct
-
namespace
-
namespace
hpx
-
namespace
serialization
Functions
-
template<typename
T
, typenameAllocator
>
voidserialize
(input_archive &ar, std::deque<T, Allocator> &d, unsigned)¶
-
template<typename
T
, typenameAllocator
>
voidserialize
(output_archive &ar, std::deque<T, Allocator> const &d, unsigned)¶
-
template<typename
-
namespace
-
namespace
hpx
-
namespace
serialization
-
namespace
util
Enums
-
enum
exception_type
¶ Values:
-
unknown_exception
= 0¶
-
std_runtime_error
= 1¶
-
std_invalid_argument
= 2¶
-
std_out_of_range
= 3¶
-
std_logic_error
= 4¶
-
std_bad_alloc
= 5¶
-
std_bad_cast
= 6¶
-
std_bad_typeid
= 7¶
-
std_bad_exception
= 8¶
-
std_exception
= 9¶
-
boost_system_error
= 10¶
-
hpx_exception
= 11¶
-
hpx_thread_interrupted_exception
= 12¶
-
std_system_error
= 14¶
-
-
enum
-
namespace
-
namespace
hpx
-
namespace
serialization
-
struct
input_archive
: public hpx::serialization::basic_archive<input_archive>¶ Public Types
-
using
base_type
= basic_archive<input_archive>¶
Public Functions
-
template<typename
Container
>input_archive
(Container &buffer, std::size_t inbound_data_size = 0, const std::vector<serialization_chunk> *chunks = nullptr)¶
-
template<typename
T
>
std::enable_if<!std::is_integral<T>::value && !std::is_enum<T>::value>::typeload
(T &t)¶
-
template<typename
T
>
std::enable_if<std::is_integral<T>::value || std::is_enum<T>::value>::typeload
(T &t)¶
-
void
load
(float &f)¶
-
void
load
(double &d)¶
-
void
load
(char &c)¶
-
void
load
(bool &b)¶
Private Functions
Private Members
-
std::unique_ptr<erased_input_container>
buffer_
¶
Friends
-
friend
hpx::serialization::basic_archive< input_archive >
-
friend
hpx::serialization::array
-
using
-
struct
-
namespace
-
namespace
hpx
-
namespace
serialization
-
template<typename
Container
>
structinput_container
: public hpx::serialization::erased_input_container¶ Public Functions
-
input_container
(Container const &cont, std::vector<serialization_chunk> const *chunks, std::size_t inbound_data_size)¶
-
void
set_filter
(binary_filter *filter)¶
Public Members
-
Container const &
cont_
¶
-
std::unique_ptr<binary_filter>
filter_
¶
-
std::vector<serialization_chunk> const *
chunks_
¶
-
-
template<typename
-
namespace
-
namespace
hpx
-
namespace
serialization
Functions
-
template<typename
T
, typenameAllocator
>
voidserialize
(input_archive &ar, std::list<T, Allocator> &ls, unsigned)¶
-
template<typename
T
, typenameAllocator
>
voidserialize
(output_archive &ar, const std::list<T, Allocator> &ls, unsigned)¶
-
template<typename
-
namespace
-
namespace
hpx
-
namespace
serialization
Functions
-
template<typename
Key
, typenameValue
>
voidserialize
(input_archive &ar, std::pair<Key, Value> &t, unsigned)¶
-
template<typename
Key
, typenameValue
>
voidserialize
(output_archive &ar, const std::pair<Key, Value> &t, unsigned)¶
-
template<typename
-
namespace
-
namespace
hpx
-
namespace
serialization
Functions
-
template<typename
T
>
voidsave
(output_archive &ar, hpx::util::optional<T> const &o, unsigned)¶
-
template<typename
T
>
voidload
(input_archive &ar, hpx::util::optional<T> &o, unsigned)¶
-
hpx::serialization::HPX_SERIALIZATION_SPLIT_FREE_TEMPLATE((template< typename T >), (hpx::util::optional< T >))
-
template<typename
-
namespace
-
namespace
hpx
-
namespace
serialization
-
struct
output_archive
: public hpx::serialization::basic_archive<output_archive>¶ Public Types
-
using
base_type
= basic_archive<output_archive>¶
Public Functions
-
template<typename
Container
>output_archive
(Container &buffer, std::uint32_t flags = 0U, std::vector<serialization_chunk> *chunks = nullptr, binary_filter *filter = nullptr)¶
-
void
reset
()¶
-
void
flush
()¶
-
bool
is_preprocessing
() const¶
Protected Functions
-
template<typename
T
>
std::enable_if<!std::is_integral<T>::value && !std::is_enum<T>::value>::typesave
(T const &t)¶
-
template<typename
T
>
std::enable_if<std::is_integral<T>::value || std::is_enum<T>::value>::typesave
(T t)¶
-
void
save
(float f)¶
-
void
save
(double d)¶
-
void
save
(char c)¶
-
void
save
(bool b)¶
Protected Attributes
-
std::unique_ptr<erased_output_container>
buffer_
¶
Private Static Functions
-
static std::uint32_t
make_flags
(std::uint32_t flags, std::vector<serialization_chunk> *chunks)¶
Friends
-
friend
hpx::serialization::basic_archive< output_archive >
-
friend
hpx::serialization::array
-
using
-
struct
-
namespace
-
namespace
hpx
-
namespace
serialization
-
template<typename
Container
, typenameChunker
>
structfiltered_output_container
: public hpx::serialization::output_container<Container, Chunker>¶ Public Types
-
template<>
usingbase_type
= output_container<Container, Chunker>¶
Public Functions
-
filtered_output_container
(Container &cont, std::vector<serialization_chunk> *chunks = nullptr)¶
-
~filtered_output_container
()¶
-
void
flush
()¶
-
void
set_filter
(binary_filter *filter)¶
-
template<>
-
template<typename
Container
, typenameChunker
>
structoutput_container
: public hpx::serialization::erased_output_container¶ Subclassed by hpx::serialization::filtered_output_container< Container, Chunker >
Public Functions
-
output_container
(Container &cont, std::vector<serialization_chunk> *chunks = nullptr)¶
-
~output_container
()¶
-
void
flush
()¶
-
void
reset
()¶
-
void
set_filter
(binary_filter*)¶
-
bool
is_preprocessing
() const¶
-
-
template<typename
-
namespace
-
template<typename
IArch
, typenameOArch
, typenameChar
>
classbasic_any
<IArch, OArch, Char, std::true_type>¶ Public Functions
-
constexpr
basic_any
()
-
basic_any
(basic_any const &x)
-
basic_any
(basic_any &&x)
-
template<typename
T
, typenameEnable
= typename std::enable_if<!std::is_same<basic_any, typename std::decay<T>::type>::value>::type>basic_any
(T &&x, typename std::enable_if<std::is_copy_constructible<typename std::decay<T>::type>::value>::type* = nullptr)
-
~basic_any
()
-
basic_any &
operator=
(basic_any const &x)
-
basic_any &
operator=
(basic_any &&rhs)
-
template<typename
T
, typenameEnable
= typename std::enable_if<!std::is_same<basic_any, typename std::decay<T>::type>::value && std::is_copy_constructible<typename std::decay<T>::type>::value>::type>
basic_any &operator=
(T &&rhs)
-
basic_any &
swap
(basic_any &x)
-
std::type_info const &
type
() const
-
template<typename
T
>
T const &cast
() const
-
bool
has_value
() const
-
void
reset
()
-
bool
equal_to
(basic_any const &rhs) const
Private Functions
-
basic_any &
assign
(basic_any const &x)
-
void
load
(IArch &ar, const unsigned version)¶
-
void
save
(OArch &ar, const unsigned version) const¶
-
HPX_SERIALIZATION_SPLIT_MEMBER
()¶
Private Static Functions
Friends
-
friend
hpx::serialization::access
-
constexpr
-
namespace
hpx
Typedefs
-
using
any
= util::basic_any<serialization::input_archive, serialization::output_archive, char, std::true_type>¶
Functions
-
template<typename
T
, typenameChar
>
util::basic_any<serialization::input_archive, serialization::output_archive, Char>make_any
(T &&t)¶
-
namespace
util
Typedefs
-
using
instead
= basic_any<serialization::input_archive, serialization::output_archive, char, std::true_type>
-
using
wany
= basic_any<serialization::input_archive, serialization::output_archive, wchar_t, std::true_type>¶
Functions
-
template<typename T, typename Char>hpx::util::HPX_DEPRECATED_V(1, 6, "hpx::util::make_any is deprecated. Please use hpx::make_any instead.")
-
template<typename
IArch
, typenameOArch
, typenameChar
>
classbasic_any
<IArch, OArch, Char, std::true_type> Public Functions
-
constexpr
basic_any
()
-
basic_any
(basic_any const &x)
-
basic_any
(basic_any &&x)
-
template<typename
T
, typenameEnable
= typename std::enable_if<!std::is_same<basic_any, typename std::decay<T>::type>::value>::type>basic_any
(T &&x, typename std::enable_if<std::is_copy_constructible<typename std::decay<T>::type>::value>::type* = nullptr)
-
~basic_any
()
-
basic_any &
operator=
(basic_any const &x)
-
basic_any &
operator=
(basic_any &&rhs)
-
template<typename
T
, typenameEnable
= typename std::enable_if<!std::is_same<basic_any, typename std::decay<T>::type>::value && std::is_copy_constructible<typename std::decay<T>::type>::value>::type>
basic_any &operator=
(T &&rhs)
-
basic_any &
swap
(basic_any &x)
-
std::type_info const &
type
() const
-
template<typename
T
>
T const &cast
() const
-
bool
has_value
() const
-
void
reset
()
-
bool
equal_to
(basic_any const &rhs) const
Private Functions
-
basic_any &
assign
(basic_any const &x)
-
void
load
(IArch &ar, const unsigned version)
-
void
save
(OArch &ar, const unsigned version) const
-
HPX_SERIALIZATION_SPLIT_MEMBER
()
Private Static Functions
Friends
-
friend
hpx::util::hpx::serialization::access
-
constexpr
-
struct
hash_any
¶ Public Functions
-
template<typename
Char
>
std::size_toperator()
(const basic_any<serialization::input_archive, serialization::output_archive, Char, std::true_type> &elem) const¶
-
template<typename
-
using
-
using
-
namespace
hpx
-
namespace
serialization
-
Functions
-
serialization_chunk
create_index_chunk
(std::size_t index, std::size_t size)¶
-
serialization_chunk
create_pointer_chunk
(void const *pos, std::size_t size, std::uint64_t rkey = 0)¶
-
union
chunk_data
¶
-
struct
serialization_chunk
¶
-
serialization_chunk
-
namespace
Defines
-
HPX_SERIALIZATION_SPLIT_MEMBER
()¶
-
HPX_SERIALIZATION_SPLIT_FREE
(T)¶
-
HPX_SERIALIZATION_SPLIT_FREE_TEMPLATE
(TEMPLATE, ARGS)¶
-
namespace
hpx
-
namespace
serialization
Functions
-
template<typename
T
>
output_archive &operator<<
(output_archive &ar, T const &t)¶
-
template<typename
T
>
input_archive &operator>>
(input_archive &ar, T &t)¶
-
template<typename
T
>
output_archive &operator&
(output_archive &ar, T const &t)¶
-
template<typename
T
>
input_archive &operator&
(input_archive &ar, T &t)¶
-
template<typename
-
namespace
-
namespace
hpx
-
namespace
serialization
-
template<typename
T
, typenameAllocator
= std::allocator<T>>
classserialize_buffer
¶ Public Types
-
template<>
usingvalue_type
= T¶
Public Functions
-
serialize_buffer
(allocator_type const &alloc = allocator_type())¶
-
serialize_buffer
(T *data, std::size_t size, init_mode mode = copy, allocator_type const &alloc = allocator_type())¶
-
template<typename
Deallocator
>serialize_buffer
(T *data, std::size_t size, allocator_type const &alloc, Deallocator const &dealloc)¶
-
template<typename
Deleter
>serialize_buffer
(T *data, std::size_t size, init_mode mode, Deleter const &deleter, allocator_type const &alloc = allocator_type())¶
-
template<typename
Deleter
>serialize_buffer
(T const *data, std::size_t size, init_mode mode, Deleter const &deleter, allocator_type const &alloc = allocator_type())¶
-
template<typename
Deallocator
, typenameDeleter
>serialize_buffer
(T *data, std::size_t size, allocator_type const &alloc, Deallocator const&, Deleter const &deleter)¶
-
template<typename
Deleter
>serialize_buffer
(T const *data, std::size_t size, Deleter const &deleter, allocator_type const &alloc = allocator_type())¶
-
serialize_buffer
(T const *data, std::size_t size, init_mode mode, allocator_type const &alloc = allocator_type())¶
-
T *
data
()¶
-
T const *
data
() const¶
-
T *
begin
()¶
-
T *
end
()¶
-
buffer_type
data_array
() const¶
Private Types
-
template<>
usingallocator_type
= Allocator¶
Private Functions
Private Static Functions
-
static void
no_deleter
(T*)¶
-
template<typename
Deallocator
>
static voiddeleter
(T *p, Deallocator dealloc, std::size_t size)¶
Friends
-
friend
hpx::serialization::hpx::serialization::access
-
bool
operator==
(serialize_buffer const &rhs, serialize_buffer const &lhs)¶
-
template<>
-
template<typename
-
namespace
-
namespace
hpx
-
namespace
serialization
-
namespace
-
namespace
hpx
-
namespace
serialization
Functions
-
namespace
-
namespace
hpx
-
namespace
serialization
-
namespace
-
namespace
hpx
-
namespace
serialization
Functions
-
template<typename
Char
, typenameCharTraits
, typenameAllocator
>
voidserialize
(input_archive &ar, std::basic_string<Char, CharTraits, Allocator> &s, unsigned)¶
-
template<typename
Char
, typenameCharTraits
, typenameAllocator
>
voidserialize
(output_archive &ar, std::basic_string<Char, CharTraits, Allocator> const &s, unsigned)¶
-
template<typename
-
namespace
-
namespace
hpx
-
namespace
serialization
-
namespace
-
namespace
hpx
-
namespace
serialization
Functions
-
template<typename
T
>
voidload
(input_archive &ar, std::unique_ptr<T> &ptr, unsigned)¶
-
template<typename
T
>
voidsave
(output_archive &ar, const std::unique_ptr<T> &ptr, unsigned)¶
-
template<typename
-
namespace
-
namespace
hpx
-
namespace
serialization
-
namespace
-
namespace
hpx
-
namespace
serialization
Functions
-
template<typename
T
>
voidserialize
(input_archive &ar, std::valarray<T> &arr, int)¶
-
template<typename
T
>
voidserialize
(output_archive &ar, std::valarray<T> const &arr, int)¶
-
template<typename
-
namespace
-
namespace
hpx
-
namespace
serialization
Functions
-
template<typename
Allocator
>
voidserialize
(input_archive &ar, std::vector<bool, Allocator> &v, unsigned)¶
-
template<typename
T
, typenameAllocator
>
voidserialize
(input_archive &ar, std::vector<T, Allocator> &v, unsigned)¶
-
template<typename
Allocator
>
voidserialize
(output_archive &ar, std::vector<bool, Allocator> const &v, unsigned)¶
-
template<typename
T
, typenameAllocator
>
voidserialize
(output_archive &ar, std::vector<T, Allocator> const &v, unsigned)¶
-
template<typename
-
namespace
Defines
-
HPX_IS_BITWISE_SERIALIZABLE
(T)¶
-
namespace
hpx
-
namespace
traits
Variables
-
template<typename T>HPX_INLINE_CONSTEXPR_VARIABLE bool hpx::traits::is_bitwise_serializable_v=is_bitwise_serializable<T>::value
-
-
namespace
Defines
-
HPX_IS_NOT_BITWISE_SERIALIZABLE
(T)¶
-
namespace
hpx
-
namespace
traits
Variables
-
template<typename T>HPX_INLINE_CONSTEXPR_VARIABLE bool hpx::traits::is_not_bitwise_serializable_v=is_not_bitwise_serializable<T>::value
-
-
namespace
Defines
-
HPX_TRAITS_NONINTRUSIVE_POLYMORPHIC
(Class)¶
-
HPX_TRAITS_NONINTRUSIVE_POLYMORPHIC_TEMPLATE
(TEMPLATE, ARG_LIST)¶
-
HPX_TRAITS_SERIALIZED_WITH_ID
(Class)¶
-
HPX_TRAITS_SERIALIZED_WITH_ID_TEMPLATE
(TEMPLATE, ARG_LIST)¶
-
namespace
hpx
-
namespace
traits
-
template<typename
Container
>
structdefault_serialization_access_data
¶ Subclassed by hpx::traits::serialization_access_data< Container >
Public Static Functions
-
static constexpr bool
is_preprocessing
()¶
-
static bool
flush
(serialization::binary_filter*, Container&, std::size_t, std::size_t size, std::size_t &written)¶
-
static constexpr std::size_t
init_data
(Container const&, serialization::binary_filter*, std::size_t, std::size_t decompressed_size)¶
-
static constexpr void
reset
(Container&)¶
-
static constexpr bool
-
template<typename
Container
>
structserialization_access_data
: public hpx::traits::default_serialization_access_data<Container>¶ Subclassed by hpx::traits::serialization_access_data< Container const >
Public Static Functions
-
static bool
flush
(serialization::binary_filter *filter, Container &cont, std::size_t current, std::size_t size, std::size_t &written)¶
-
static std::size_t
init_data
(Container const &cont, serialization::binary_filter *filter, std::size_t current, std::size_t decompressed_size)¶
-
static bool
-
template<typename
-
namespace