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

Serialization failing for struct containing vector of vectors of other structs

I am working on a final project for a class and am trying to use the cereal library to serialize a struct that contains a vector of vectors of another type of structs, and this is failing. The other (contained within vector) type of struct has a…
0
votes
1 answer

cereal compiles and runs, but does not write to file

The following code does not write to file. #include #include { vector v = { 1,2,3 }; stringstream s; s << "cereal_test.xml"; cereal::XMLOutputArchive oarchive(s); …
WurmD
  • 1,231
  • 5
  • 21
  • 42
0
votes
1 answer

Setting a property that I can access in the serialize functions when using Cereal serialization library

I'm using the 'Cereal' serialization library (uscilab.github.io/cereal/) to serialize objects that can have millions of numbers, and the meta-data that describes the numbers. In some instances, I do not need the numbers to be serialized, just the…
0
votes
0 answers

Segmentation Fault and memory leaking when passing serialized data to a socket

I'm toying with ZeroMQ and Cereal to pass data structures (mostly std::vector of numeric types) between different processes. I've managed to successfully achieve what I wanted, but I'm getting a Segmentation Fault at the end of execution, and after…
joaocandre
  • 1,621
  • 4
  • 25
  • 42
0
votes
1 answer

C++ Serialization with Cereal error: Cereal does not support serializing raw pointers

I'm using the Cereal C++ serialization library (https://uscilab.github.io/cereal/index.html) to serialize some data. The data types that I am trying to serialize mostly include vectors of vectors (e.g.: vector>) and basic types (e.g.:…
Sleepless
  • 103
  • 2
  • 2
  • 12
0
votes
1 answer

How to serialize multidimensional array on cereal, C++ serialize library

Does anyone know how to serialize multidimensional array on cereal, C++ library? I tested by the source code shown below. but, it complains "error C2338: Cereal does not support serializing raw pointers - please use a smart pointer" As shown in…
ric
  • 129
  • 1
  • 3
  • 11
0
votes
2 answers

Examples of using cereal serialization and boost::asio?

I'm trying to serialize objects/messages and send them as UDP packets between nodes. I'm currently looking at cereal for serialization and boost::asio for actual network programming. Are there any examples of using these two libraries together, even…
jest jest
  • 125
  • 1
  • 2
  • 8
0
votes
0 answers

Unexpected Behaviour in Cereal while Retrieving Object From Ignite Server using Redis Client

Below is my sample code through which i'm trying to benchmark hiredis client with IgniteServer to Store and Retrieve a C++ Class Object after serializing. #include #include #include #include #include…
Prakash GiBBs
  • 297
  • 2
  • 13
0
votes
0 answers

Explicitly linking DLLs causes exception

I have a problem using cereal with dynamic libraries on Windows (DLLs). I have read the documentation on the cereal site. However, all documentation and examples implicitly link DLLs, while I need to be able to explicitly link my DLLs. I made an…
resul4e
  • 1
  • 3
0
votes
1 answer

Trouble deserializing cereal PortableBinaryArchive

I face a std::length exception using the cereal library to deserialize a std::vector full of a class of my own. I think it's easiest if I give some code. This is my class: #include "cereal/archives/portable_binary.hpp" #include…
0
votes
1 answer

cereal + armadillo + json serialization

Does anyone have an example of Cereal based armadillo matrix serialization to JSON? Binary serialization below seems to be working. Inside mat_extra_meat.hpp template typename…
SparcU
  • 742
  • 1
  • 7
  • 27
0
votes
0 answers

Serialize armadillo matrix using cereal

I am trying to implement armadillo matrix serialization using Cereal library. SO has sample here. Unfortunately I cannot use Boost. So far I got this. Inside mat_extra_meat.hpp template typename…
SparcU
  • 742
  • 1
  • 7
  • 27
0
votes
1 answer

Cereal Nested Objects

How should I proceed to serialize a nested object? Example: class B { public: int y; template void serialize(Archive& ar) { ar(CEREAL_NVP(y)); } } class A { public: int x; std::vector nested; …
0
votes
3 answers

How to use cereal to serialize enum types?

For example enum Color {RED, BLUE, YELLOW}; And I want to serialize the type with cereal Color c = RED; JSONOutputArchive archive(std::cout); archive(c); Output looks like "value0" : "RED" or "value0" : RED
user1899020
  • 13,167
  • 21
  • 79
  • 154
0
votes
1 answer

Cereal Binary Archive Serialize/Deserialize

I'm using the following code to attempt to serialize/deserialize an object as binary data: MyDTO dto1; std::ostringstream os(std::stringstream::binary); { cereal::BinaryOutputArchive oarchive(os); // Create an output archive …
Brian Templeton
  • 106
  • 2
  • 10
1 2 3
8
9