-
-
Notifications
You must be signed in to change notification settings - Fork 427
/
partitioned_vector.hpp
43 lines (37 loc) · 1.28 KB
/
partitioned_vector.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// Copyright (c) 2017 Christopher Taylor
//
// SPDX-License-Identifier: BSL-1.0
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#ifndef HPX_SERIALIZATION_PARTITIONED_VECTOR_HPP
#define HPX_SERIALIZATION_PARTITIONED_VECTOR_HPP
#include <hpx/config.hpp>
#include <hpx/components/containers/partitioned_vector/partitioned_vector_decl.hpp>
#include <hpx/serialization/serialize.hpp>
#include <hpx/errors.hpp>
#include <string>
namespace hpx { namespace serialization
{
template <typename T>
void serialize(input_archive& ar, hpx::partitioned_vector<T>& v, unsigned)
{
std::string pvec_registered_name;
ar >> pvec_registered_name;
v.connect_to(pvec_registered_name).get();
}
template <typename T>
void serialize(
output_archive& ar, const hpx::partitioned_vector<T>& v, unsigned)
{
std::string pvec_registered_name = v.registered_name();
if (pvec_registered_name.empty())
{
HPX_THROW_EXCEPTION(
hpx::invalid_status,
"hpx::serialization::serialize",
"partitioned_vector is not registered");
}
ar << pvec_registered_name;
}
}}
#endif