Pothos  0.5.0-ga4964040
The Pothos dataflow programming software suite
String.hpp
Go to the documentation of this file.
1 
11 #pragma once
12 #include <Pothos/Config.hpp>
16 #include <string>
17 
18 namespace Pothos {
19 namespace serialization {
20 
21 template<typename Archive, typename T, typename Traits, typename Allocator>
22 void save(Archive &ar, const std::basic_string<T, Traits, Allocator> &t, const unsigned int)
23 {
24  ar << unsigned(t.size());
25  BinaryObject bo(t.data(), t.size());
26  ar << bo;
27 }
28 
29 template<typename Archive, typename T, typename Traits, typename Allocator>
30 void load(Archive &ar, std::basic_string<T, Traits, Allocator> &t, const unsigned int)
31 {
32  unsigned size(0);
33  ar >> size;
34  t.resize(size);
35  BinaryObject bo(t.data(), t.size());
36  ar >> bo;
37 }
38 
39 template <typename Archive, typename T, typename Traits, typename Allocator>
40 void serialize(Archive &ar, std::basic_string<T, Traits, Allocator> &t, const unsigned int ver)
41 {
43 }
44 
45 }}
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
Definition: BinaryObject.hpp:23
void load(Archive &ar, std::complex< T > &t, const unsigned int)
Definition: Complex.hpp:27