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
2
votes
0 answers

Deserializing sparsepp sparse_hash_map with const keys using cereal

I'm trying to serialize and deserialize a sparsepp spp::sparse_hash_map of type spp::sparse_hash_map, uint32_t> using cereal. See related question on why I use a const key here. However, compilation of the following code…
Dänu
  • 5,791
  • 9
  • 43
  • 56
2
votes
1 answer

C++ Cereal save/load_and_construct not working

So I'm trying to use the Cereal library and I've come to an issue I can't seem to overcome. Essentially the doc's say it is possible to deserialize Types with no default constructor. Yet in the implementation notes it says Define a serialize or…
Hex Crown
  • 753
  • 9
  • 22
2
votes
1 answer

Any way for template substitution to happen before argument dependent lookup (or workarounds?)

I suppose the basic premise of this question is that I'm trying to use enable_if along with Argument Dependent Lookup (ADL), but I'm not sure if it's possible. I do see on this page that Template argument deduction takes place after the function…
Nickolai
  • 1,579
  • 2
  • 12
  • 19
2
votes
0 answers

Cereal std::vector serialization

I want to give a shot to cereal serialization library . I am at beginner level c++ and retired level at java :) I try to serialize vector with it but cant. Any suggestion ? I have below codes and gives an error. What am I missing here ? struct…
2adnielsenx xx
  • 488
  • 1
  • 5
  • 22
2
votes
1 answer

Cereal could not find any Output serialization functions

I do not know why I am getting this error when trying to compile. I have tried adding almost all of the types. I am trying to serialize a set of RegDoneEntry's . I know the call to serialize is not here but I can't get beyond just this. The below…
Jeff
  • 2,061
  • 4
  • 27
  • 45
2
votes
1 answer

C++ cereal de-serialization trouble with large size vector

I hope to serialize large size vector with cereal, C++ serialization library. But, if trying to do that, the exception "Failed to read " + std::to_string(size) + " bytes from input stream! Read " + std::to_string(readSize)" is thrown. Does anyone…
ric
  • 129
  • 1
  • 3
  • 11
2
votes
1 answer

Can't serialize std::vector with Cereal

I'm new to serialization, and I'm having trouble serializing std::vector objects with the Cereal library. Here's a sample that illustrates the problem: class MyClass { int x, y, z; class MyOtherClass { string name,…
greentea101
  • 51
  • 1
  • 6
2
votes
2 answers

Cereal serialization

I have a problem in C++11 with cereal (http://uscilab.github.io/cereal/). I have a shared library, and I would like to serialize one of its classes using cereal library. Here is a part of the code of the library "I would like to serialize Object…
Ahmed Nour
  • 29
  • 1
  • 5
2
votes
1 answer

using cereal and boost serialisation in the same program

We currently have a system that uses a lot of boost serialisation to store data. We are looking to migrate away from this, to using cereal instead. However, it is very unlikely that we will be able to completely migrate all serialised objects. At…
Simon Callan
  • 3,020
  • 1
  • 23
  • 34
2
votes
1 answer

Cereal: deserialize a vector of objects without default constructor

I'm trying to use Cereal to serialize an object without default constructor. Storing such objects directly or via smart pointer works. However, when I put the object into a container, it no longer compiles: error: no matching function for call to…
BoshWash
  • 5,320
  • 4
  • 30
  • 50
2
votes
1 answer

How do I serialize std::chrono::minutes

How do I serialize std::chrono::minutes with cereal or in general? I tried this struct A { std::chrono::minutes m; template void serialize(Archive& ar) { ar(m); } }; int main() { A a; …
Damian
  • 4,395
  • 4
  • 39
  • 67
2
votes
1 answer

C++/Cereal: Exception while deserializing from JSON to own class

I'm trying to load parameters from a JSON file into my own parameter class using cereal (v1.12) on VS2013. Compilation and loading into a POD works fine, but loading into my own class throws cereal::RapidJSONException. Here is my code: #include…
Stefan Densow
  • 143
  • 1
  • 8
2
votes
1 answer

Cereal: Serializing polymorphic type

I am experiencing problems serializing a polymorphic type. Actually I just split the example in: http://uscilab.github.io/cereal/polymorphism.html in several files. It compiles just fine but in runtime i get an exception telling me that I cannot…
tuxroger
  • 21
  • 2
2
votes
1 answer

how to create manually a file for cereal import?

I would like to create a (json) file manually (with python) and load it then with cereal into my c++ application. Saving and loading using ceral works fine. However, the polymorphic_ids in the json file are not clear to me. Here a more clear…
mojovski
  • 581
  • 7
  • 21
2
votes
3 answers

cereal serialization and polymorphism

Ok so I'm running into a problem in C++11 with cereal (http://uscilab.github.io/cereal/). In an abstract sense I have a large graph which I am serializing with lots of shared pointers connecting the edges and vertices. Edges (and vertices) also…
David Mokon Bond
  • 1,576
  • 2
  • 18
  • 42
1 2
3
8 9