28 #include <boost/serialization/version.hpp> 29 #include <boost/serialization/optional.hpp> 30 #include <boost/serialization/shared_ptr.hpp> 31 #include <boost/serialization/vector.hpp> 32 #include <boost/serialization/map.hpp> 33 #include <boost/serialization/list.hpp> 34 #include <boost/serialization/deque.hpp> 35 #include <boost/serialization/weak_ptr.hpp> 37 #include <boost/archive/text_oarchive.hpp> 38 #include <boost/archive/text_iarchive.hpp> 39 #include <boost/archive/xml_iarchive.hpp> 40 #include <boost/archive/xml_oarchive.hpp> 41 #include <boost/archive/binary_iarchive.hpp> 42 #include <boost/archive/binary_oarchive.hpp> 43 #include <boost/serialization/export.hpp> 48 #if __GNUC__ >= 7 && __cplusplus >= 201703L 49 namespace boost {
namespace serialization {
struct U; } }
65 boost::archive::text_oarchive out_archive(out_archive_stream);
72 boost::archive::text_iarchive in_archive(in_archive_stream);
79 std::ostringstream out_archive_stream;
81 return out_archive_stream.str();
87 std::istringstream in_archive_stream(serialized);
94 std::ofstream out_archive_stream(filename.c_str());
95 if (!out_archive_stream.is_open())
return false;
97 out_archive_stream.close();
104 std::ifstream in_archive_stream(filename.c_str());
105 if (!in_archive_stream.is_open())
return false;
107 in_archive_stream.close();
131 const std::string&
name =
"data") {
132 boost::archive::xml_oarchive out_archive(out_archive_stream);
133 out_archive << boost::serialization::make_nvp(
name.c_str(), input);
139 const std::string&
name =
"data") {
140 boost::archive::xml_iarchive in_archive(in_archive_stream);
141 in_archive >> boost::serialization::make_nvp(
name.c_str(), output);
147 const std::string&
name =
"data") {
148 std::ostringstream out_archive_stream;
150 return out_archive_stream.str();
156 const std::string&
name =
"data") {
157 std::istringstream in_archive_stream(serialized);
164 const std::string&
name =
"data") {
165 std::ofstream out_archive_stream(filename.c_str());
166 if (!out_archive_stream.is_open())
return false;
168 out_archive_stream.close();
175 const std::string&
name =
"data") {
176 std::ifstream in_archive_stream(filename.c_str());
177 if (!in_archive_stream.is_open())
return false;
179 in_archive_stream.close();
186 const std::string&
name =
"data") {
193 const std::string&
name =
"data") {
205 const std::string&
name =
"data") {
206 boost::archive::binary_oarchive out_archive(out_archive_stream);
207 out_archive << boost::serialization::make_nvp(
name.c_str(), input);
213 const std::string&
name =
"data") {
214 boost::archive::binary_iarchive in_archive(in_archive_stream);
215 in_archive >> boost::serialization::make_nvp(
name.c_str(), output);
221 const std::string&
name =
"data") {
222 std::ostringstream out_archive_stream;
224 return out_archive_stream.str();
230 const std::string&
name =
"data") {
231 std::istringstream in_archive_stream(serialized);
238 const std::string&
name =
"data") {
239 std::ofstream out_archive_stream(filename.c_str());
240 if (!out_archive_stream.is_open())
return false;
242 out_archive_stream.close();
249 const std::string&
name =
"data") {
250 std::ifstream in_archive_stream(filename.c_str());
251 if (!in_archive_stream.is_open())
return false;
253 in_archive_stream.close();
260 const std::string&
name =
"data") {
267 const std::string&
name =
"data") {
bool deserializeFromFile(const std::string &filename, T &output)
deserializes from a file
void deserializeFromXMLStream(std::istream &in_archive_stream, T &output, const std::string &name="data")
deserializes from a stream in XML
std::string serializeToXMLString(const T &input, const std::string &name="data")
serializes to a string in XML
void serializeToStream(const T &input, std::ostream &out_archive_stream)
std::string serialize(const T &input)
serializes to a string
bool serializeToFile(const T &input, const std::string &filename)
serializes to a file
std::string serializeToBinaryString(const T &input, const std::string &name="data")
serializes to a string in binary
Namespace containing all symbols from the Eigen library.
void deserializeFromStream(std::istream &in_archive_stream, T &output)
deserializes from a stream
void deserializeXML(const std::string &serialized, T &output, const std::string &name="data")
deserializes from a string in XML
bool serializeToBinaryFile(const T &input, const std::string &filename, const std::string &name="data")
serializes to a binary file
void serializeToBinaryStream(const T &input, std::ostream &out_archive_stream, const std::string &name="data")
void deserializeFromString(const std::string &serialized, T &output)
deserializes from a string
void deserializeFromXMLString(const std::string &serialized, T &output, const std::string &name="data")
deserializes from a string in XML
void deserializeBinary(const std::string &serialized, T &output, const std::string &name="data")
deserializes from a string in binary
void deserializeFromBinaryString(const std::string &serialized, T &output, const std::string &name="data")
deserializes from a string in binary
bool deserializeFromXMLFile(const std::string &filename, T &output, const std::string &name="data")
deserializes from an XML file
A small structure to hold a non zero as a triplet (i,j,value).
void deserialize(const std::string &serialized, T &output)
deserializes from a string
std::string serializeXML(const T &input, const std::string &name="data")
serializes to a string in XML
bool serializeToXMLFile(const T &input, const std::string &filename, const std::string &name="data")
serializes to an XML file
Annotation for function names.
void deserializeFromBinaryStream(std::istream &in_archive_stream, T &output, const std::string &name="data")
deserializes from a stream in binary
bool deserializeFromBinaryFile(const std::string &filename, T &output, const std::string &name="data")
deserializes from a binary file
std::string serializeBinary(const T &input, const std::string &name="data")
serializes to a string in binary
std::string serializeToString(const T &input)
serializes to a string
void serializeToXMLStream(const T &input, std::ostream &out_archive_stream, const std::string &name="data")