Pothos  0.5.0-ga4964040
The Pothos dataflow programming software suite
Set.hpp
Go to the documentation of this file.
1 
11 #pragma once
12 #include <Pothos/Config.hpp>
15 #include <utility> //move
16 #include <set>
17 
18 namespace Pothos {
19 namespace serialization {
20 
21 template<typename Archive, typename T, typename Compare, typename Allocator>
22 void save(Archive &ar, const std::set<T, Compare, Allocator> &t, const unsigned int)
23 {
24  ar << unsigned(t.size());
25  for (const auto &elem : t)
26  {
27  ar << elem;
28  }
29 }
30 
31 template<typename Archive, typename T, typename Compare, typename Allocator>
32 void load(Archive &ar, std::set<T, Compare, Allocator> &t, const unsigned int)
33 {
34  t.clear();
35  unsigned size(0);
36  ar >> size;
37  for (size_t i = 0; i < size_t(size); i++)
38  {
39  T elem;
40  ar >> elem;
41  t.insert(std::move(elem));
42  }
43 }
44 
45 template <typename Archive, typename T, typename Compare, typename Allocator>
46 void serialize(Archive &ar, std::set<T, Compare, Allocator> &t, const unsigned int ver)
47 {
49 }
50 
51 }}
Definition: ArchiveEntry.hpp:20
void save(Archive &ar, const std::complex< T > &t, const unsigned int)
Definition: Complex.hpp:20
void serialize(Archive &ar, std::complex< T > &t, const unsigned int ver)
Definition: Complex.hpp:37
std::enable_if< std::is_same< typename Archive::isSave, std::true_type >::value >::type invokeSplit(Archive &ar, T &value, const unsigned int ver)
Definition: Invoke.hpp:69
void load(Archive &ar, std::complex< T > &t, const unsigned int)
Definition: Complex.hpp:27