Questions tagged [cereal]
A C++11 serialization library
cereal
142
questions
0
votes
0
answers
23
views
Cereal archive called from DLL cause polymorphism not to work
I am a newbie to cereal and lately I ran into an odd issue,
I have my serialization code inside an external DLL, in the code I use cereal's polymorphism functionality, when trying to invoke the ...
0
votes
1
answer
41
views
Serialize/ Deserialize ID instead of object in cereal
I want to serialize structs using cereal. One of them looks like this:
struct Material {
std::shared_ptr<Texture> texture1;
std::shared_ptr<Texture> texture2;
};
In my program, ...
1
vote
1
answer
109
views
Unable to compile Cereal Serialize/Deserialize code using BinaryInputArchive/BinaryOutputArchive
#include <iostream>
#include <sstream>
#include <cereal/archives/json.hpp>
#include <cereal/archives/binary.hpp>
#include <string_view>
#include <format>
...
0
votes
0
answers
82
views
Cereal Library static_assert failed 'cereal could not find any output serialization functions for the provided type and archive combination.'
I am trying to serialize SFML shapes for a 2D ms paint like program. I am getting an assertion error during build but everything online I can find it is a result of not marking a function with the ...
0
votes
0
answers
84
views
How to deserialize a JSON null value with the cereal C++ library?
I'm using the C++ cereal library to handle JSON serialization/deserialization in my Android application. I saw that cereal added support for the std::optional type. So after targeting C++17 in my ...
1
vote
1
answer
62
views
How to use Cereal to serialize an igraph graph without getting AddressSanitizer issues?
I have a graph, produced using the igraph library.
Now, I would like to serialize this graph.
While igraph provides some methods to convert the graph to a file, they all lack either support for ...
0
votes
0
answers
39
views
How to serialize structs containing unions using the Cereal C++11 library?
How does the Cereal C++11 library handle unions within structs? For example:
enum class Tag { eInt, eFloat };
struct myStruct
{
Tag tag;
union
{
int i;
float f;
} val;
...
0
votes
0
answers
82
views
How to use cereal to serialize enum types with magic_enum?
I tried to use magic_enum with cereal to serialize a enum type.
Here is my code, and it's worked on serialize but got an error with deserialize.
template <class Archive,
cereal::traits::...
0
votes
0
answers
97
views
C++ Cereal Deserialize Failure <cereal::JSONInputArchive>(cereal::JSONInputArchive&)
Context:
I have a lib that uses Cereal to serialize/deserialize a json file, it is written in C++ and with a Python wrapper to help it being called from the pipeline.
Here are some scenarios showing ...
1
vote
1
answer
249
views
serialize with Cereal in MFC
I'm trying to use cereal (C++ serialization library) in the MFC project.
It works fine if I add an "internal serialize function" inside of the custom struct that I want to serialize.
But, if ...
0
votes
2
answers
221
views
How to resolve JSON serialization error with cereal c++?
I encountered the following runtime error with cereal when trying serialize the class with JSON:
libc++abi: terminating with uncaught exception of type cereal::RapidJSONException: rapidjson internal ...
1
vote
2
answers
796
views
Using c++ cereal library, I want to serialize the child, and then the base class. Only base class serialize is getting called
I am using the cereal library. The idea is to have a base class that serializes itself, and the derived class would serialize itself, and the base class. This is an example almost verbatim from the ...
0
votes
0
answers
245
views
Deserializing JSON using cereal
I'm trying to get the cereal serialization library to emit string representations of enums. I'm using the magic_enum library to perform the conversions between the enum and string.
While I have no ...
0
votes
0
answers
155
views
C++ Cereal XML-Archive not working with stringstream
I am trying to get cereal-serialization to work. But somehow it does not work with the XML-Archive in combination with a stringstream.
Here is my example:
std::stringstream ss;
cereal::...
0
votes
1
answer
162
views
Code to store Eigen tensors as binary files
Based on the excellent answers here, I tried to build a method to serialize Eigen tensors.
Based on the cereal package I tried the following:
namespace cereal
{
template <class Archive, class ...