Pothos  0.7.0-gf7fbae99
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
std::enable_if< Archive::isSave::value >::type invokeSplit(Archive &ar, T &value, const unsigned int ver)
Definition: Invoke.hpp:69
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
Definition: BinaryObject.hpp:23
void load(Archive &ar, std::complex< T > &t, const unsigned int)
Definition: Complex.hpp:27