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
1
vote
1 answer

Cereal serialisation issue for std::chrono with dynamic library

I have a problem with cereal library (http://uscilab.github.io/cereal/). I have a shared library, and I would like to serialize one of its classes using cereal library. It has a member of time_point from std::chrono Here is a part of the code of my…
Minee
  • 408
  • 5
  • 12
1
vote
1 answer

How to use cerial serialization

I'm trying to figure out how Cereal serialization works, so i read the documentation (which i find a little lacking imo) and tried to reproduce the code they have in there: #include #include struct MyData { int x,…
Real
  • 91
  • 6
1
vote
1 answer

Issue correctly using CEREAL_REGISTER_DYNAMIC_INIT in C++ Cereal library

I've moved to using a lib file and wanted to make use of CEREAL_REGISTER_DYNAMIC_INIT properly. I don't know if I need to use this, but I noticed an issue with one of my cerealization types not being picked up properly in a separate DLL and thought…
M2tM
  • 4,415
  • 1
  • 34
  • 43
1
vote
2 answers

Cereal Polymorphic Serialization couldnt find serialization function

I'm currently trying to create a Base Class Serializable with static functions to serialize and deserialize derived Class Objects. I've read the Cereal Documentation for registering Polymorphic Relations and how to register types and also how to…
MNCODE
  • 159
  • 3
  • 16
1
vote
1 answer

Deserialization of multiple objects with POCO and cereal in C++

I'm trying to send some objects from one program to the other over the network using POCO::Net to handle the connection and cereal to handle the serialization. All packets are inherited from single base, BasePacket. class BasePacket {}; typedef…
stilgar
  • 101
  • 4
1
vote
1 answer

Cereal serialize CString Vector

EDIT:// Got it working thanks to the answer below, adding the code that is currently working and test case just in case some one might find it useful. // Add as another type for Cereal or inside string.hpp in Cereal includes template
1
vote
0 answers

Can cereal serialization be more performant and deterministic?

I have been using cereal in highly time-sensitive software where every microsecond counts. My program runs in a loop and serializes a struct on every iteration. The struct contains some STL containers and strings and thus the size can vary between…
L. Chang
  • 11
  • 3
1
vote
1 answer

Binary file writer adds extra byte

I'm building a Conduit that writes a binary file consisting of a header followed by a Double matrix as a row-ordered list. Here's the code: import Conduit ((.|), ConduitM, mapC, sinkFileBS, yield) import Control.Monad.Trans.Except (ExceptT) import…
jorgen
  • 3,425
  • 4
  • 31
  • 53
1
vote
1 answer

Serialize/deserialize SFML Vectors class using cereal

I'm using SFML and cereal to serialize/deserialize data and I want to do that for sf::vector2 and sf::vector3 class: Data.h #include #include #include #include…
1
vote
1 answer

Cereal: Shared serialization function across enums

Lets suppose I have something like: enum t_color { BLUE=0,RED,GREEN}; vector TAG_color={"BLUE", "RED", "GREEN"}; enum t_colores { AZUL=0,ROJO,VERDE}; vector TAG_colores={"AZUL", "ROJO", "VERDE"}; I want to use (in cereal) a common…
vpuente
  • 882
  • 7
  • 15
1
vote
0 answers

Why does my cereal template have undefined reference linker errors for the release build but not for the debug build?

I am using CMake to generate some build environments: cmake .. -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Debug -DBUILD_SHARED_LIBS=TRUE cmake .. -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=TRUE cmake .. …
MatrixManAtYrService
  • 8,023
  • 1
  • 50
  • 61
1
vote
0 answers

Serialization in embedded - using cereal without RTTI?

I want to use Cereal 1.2.1 in an embedded system, so I can't use RTTI as it's adding lots of code size. I have to drop support for typeid. Is there a way to use Cereal without RTTI? The structures I'm serializing are not polymorphic, just containers…
G. Ko
  • 403
  • 6
  • 15
1
vote
0 answers

C++ Serialization with Cereal - How to best serialize polymorphic classes

I'm about to implement serialization of my object graph (actually a tree) with Cereal. Cereal does not support serializing raw pointers (the objects that these pointers point to). My current idea is to have a getType() function on the objects to…
keyboard
  • 2,137
  • 1
  • 20
  • 32
1
vote
1 answer

"cereal::Exception" when de-serializing polymorphic types with named value pairs(nvp)

i'm getting a "cereal::Exception" with message: "JSON parsing failed - provided NVP not found" when trying to de-serialize a polymorphic class that serialized named value pairs. Am I doing something wrong? here is the header: #ifndef…
1
vote
0 answers

Using Cereal, how to use C-Style array serialization with polymorphic classes?

I have a simple classe here : template class clDaughter { public: T* __pData; uint16_t __u16Size; clDaughter() [...] ~clDaughter() [...] clDaughter(uint16_t const ku16Size) { this->__pData =…
Daemon Pulsar
  • 13
  • 1
  • 5
1 2 3
8 9