Questions tagged [cereal]

A C++11 serialization library

cereal is a header-only C++11 serialization library. cereal takes arbitrary data types and reversibly turns them into different representations, such as compact binary encodings, XML, or JSON. cereal was designed to be fast, light-weight, and easy to extend - it has no external dependencies and can be easily bundled with other code or used standalone.

135 questions
0
votes
1 answer

Cereal seems to not properly serialize an std::string

I am trying to serialize a class into a binary, to that effect I first started trying to serialize an std::string member within the class, I wrote this serialization method: template void ShaderProgram::serialize(Archive& archive,…
Makogan
  • 8,208
  • 7
  • 44
  • 112
0
votes
1 answer

C++: How to pass the object from a unique_ptr into a function by value?

I would like to use the cereal library from this github page to load xml into objects. Up to this point everything is fine. But in my application, it is a bit more complex: the object that needs to be loaded/filled by the xml file, have to be…
R. N
  • 707
  • 11
  • 31
0
votes
2 answers

I want to serialize a vector of structs containing ints and it does not work (cereal library)

I am using the cereal library to serialize stuff. I am trying to serialize a class member of type std::vector with struct{ some unsingned short ints }. This fails with the compiler message /usr/include/cereal/cereal.hpp:543: error: static assertion…
user11931376
0
votes
2 answers

How to add a header only library to a project with cmake build system?

I need to modify a C++ project to use Cereal library. The build system of this project is based on CMake. Since Cereal is a header only library and also uses CMake, I expect this to be a pretty simple task. I tried editing the CMakeLists.txt…
Armut
  • 969
  • 8
  • 22
0
votes
1 answer

Cereal macro for vector

ALL. In the cereal there is a macro CEREAL_NVP, that is suitable for the map/pair. Is there some kind of macro suitable for std::vector? I have: private: std::vector RecordVector; template void serialize(…
Igor
  • 5,620
  • 11
  • 51
  • 103
0
votes
0 answers

Parsing a complete JSON array from a text buffer

I'm receiving a JSON array over web sockets, and I have a buffer which is built up, currently I'm assuming that I'll receive the complete JSON array, with nested JSON objects and arrays. But I know from experience that often these strings can be…
Alex
  • 669
  • 15
  • 37
0
votes
1 answer

How can I read cereal serialized data from C++ using Python

I'm using rospy and roscpp to connect each other. One of the roscpp node published a cereal binary archive topic and is subscribed by rospy node. How can I read the cereal binary archive using python?
CHOcho
  • 1
0
votes
0 answers

Serializing object members within unordered_map and storing into binary file

I'm making a multiplayer game, the Server stores it's game world state as various std::unordered_map in a class called ServerWorldState. The server is composed by a single class called Game, which contains ServerWorldState. Currently I'm trying to…
Mithrandir
  • 33
  • 6
0
votes
1 answer

I'm getting a strange error when I try to do serialization with cereal in C++

I keep getting this strange error /usr/bin/ld: CMakeFiles/libdungeon.dir/src/main.cpp.o: in function `decltype (({parm#2}.serialize)({parm#1})) cereal::access::member_serialize(cereal ::BinaryOutputArchive&,…
Skye
  • 3
  • 1
0
votes
1 answer

Serialise/Unserialise structure to XML using cerealwithout modifying the structure interface

My situation is as follow, as part of testing an API interface I need to save some references (structure and vectors of structures) as XML. The saved XML file would eventually be used to retrieve the reference structure and compare to the current…
Guillaume.P
  • 421
  • 1
  • 4
  • 12
0
votes
0 answers

Cereal alternative to startNode method

I'm using cereal with c++ to serialise and deserialise JSON. My Json objects all have a base class, this sort of maps to the JSON like so... ["baseclass_var1", "baseclass_var2", 21321, {"derived_object_var1":"blah",…
Alex
  • 669
  • 15
  • 37
0
votes
1 answer

How do I import the Cereal Library into Visual Studio?

Sorry for the newbie question. I have it downloaded and have got this far.
0
votes
1 answer

Boost and cereal serialization integrity

I looked at documentations of both Boost Serialization and Cereal library but I didn't find anything specific. I'm wondering if it's possible to have an integrity check in the serialized data. I'm not talking about the security aspect but if for any…
greywolf82
  • 21,813
  • 18
  • 54
  • 108
0
votes
0 answers

unable to determine rapidjson type / difficult to read triple nested strings

I'm trying to use cereal to deserialize a JSON message. The (current) message structure is as follows: "A":"B", "C":{"D":"E","F":"G","H":"I"}, "J":"K", "L":"M", "N":{"O":{"P":"Q"}}} The most important piece of data is "Q." I can read all the…
pthien
  • 23
  • 1
  • 8
0
votes
1 answer

How to serialize unique_ptr in struct

I haven't been able to find any docs on how to serialize a unique_ptr to an array. Any help would be great. struct Counter{ int index; unique_ptr name; template void serialize(Archive & archive){ …
1 2 3
8 9