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: how to manage the implementation struct for the PIMPL idiom

I am having troubles to use cereal with the PIMPL idiom. This is a minimal example: b.h #ifndef _B_H_ #define _B_H_ #include #include "cereal/types/memory.hpp" #include "cereal/archives/json.hpp" struct BImpl; class B { public: …
gmas80
  • 1,218
  • 1
  • 14
  • 44
0
votes
1 answer

LZ4 Decompress Binary Memory Block Of Unknown Size

I'm trying to decompress a block of memory but I don't know it's original uncompressed size, however, I do know the maximum size this original block of memory could ever be. Is there any way to decompress with LZ4 without knowing the original…
KKlouzal
  • 732
  • 9
  • 32
0
votes
0 answers

Cereal 1.2.0 - "looser throw specifier" error using JSON or XML archive

I just moved on Cereal 1.2.0 (moved from 1.1.2), and I obtain a compilation error when using JSONOutputArchive or XMLOutputArchive (i.e. including either "cereal/archives/json.hpp" or "cereal/archives/xml.hpp") std::stringstream…
Daemon Pulsar
  • 13
  • 1
  • 5
0
votes
1 answer

how cereal load or save XML attribute

I'm trying to save/load XML file use cereal, but can not figure out how to save/load XML attribute. For example: I have a XML file: and a struct struct window { int height; int width; } how can i…
0
votes
1 answer

Accept null values for strings with rapidjson inside cereal, make them ""

For deserializing JSON into a c++ class, I'm using Cereal, which uses RapidJSON. As expected, c++ std::string can't have a null value. But other platforms do support null for strings (.NET SQL etc) and I get JSON from them with null values for…
Yaniv
  • 504
  • 4
  • 10
0
votes
1 answer

Preventing cereal from writing polymorphic type data

I'm using cereal for serialization to a simple packet format for an existing protocol. However cereal is prefixing the serialized data with portable type information, which I don't want. I don't need to deserialize polymorphic types. Is there any…
jossgray
  • 497
  • 6
  • 20
0
votes
1 answer

Looking for an example of how to access data in deserialized cereal .xml files (Cereal, C++11)

Im trying to learn how to use serialization/deserialization at the moment, using cereal. To test things out, I serialized the objects of a 3D scene into a .xml file (it's easier to understand when you can actually read the output, after all). The…
UnHeinz
  • 1
  • 3
0
votes
1 answer

Serialization with cereal: read only first variables

I am serializing some data with the cereal lib. I am serializing a number of variables, among float, double, std::vector. I write it as cereal::BinaryOutputArchive archive(ofile); int _pts_size, _num_cams; std::vector
manatttta
  • 3,054
  • 4
  • 34
  • 72
0
votes
2 answers

VS2013 create several dll files with different classes to serialize with cereal

I tried to split some polymorphic classes to be serialized into a dll file. Then I get an exception for unregistered polymorphic type. The problem seems to be that the code create two instances of the map used to lookup polymorphic objects (Kept by…
R.Undheim
  • 3
  • 2
0
votes
1 answer

Serialize Templatized Sub Class

Thank you very much for your time I really appreciate it There is a templatized subclass that needs to be serialized with the Cereal Serialization Library, the baseclass is empty, it only exists so we can have a vector of shared_ptr to the base…
KKlouzal
  • 732
  • 9
  • 32
0
votes
1 answer

Cereal library error using enable_shared_from_this

EDIT: Created a minimal VS solution to make it easier to reproduce the error: https://www.dropbox.com/s/pk0t8t2xykjmtc5/test%20cereal%20this.zip (add cereal in includes instead of $(LIBSROOT) where I have it). I get 2 errors stating that I have no…
Nakamp
  • 120
  • 1
  • 8
0
votes
1 answer

C++11 Cereal: load_and_allocate not loading correctly

I am using cereal, a C++11 serialization library. I am uncertain if this is a bug with the library or an issue with how I am using it and I would like some assistance. Given the following minimal repro which is representative (but not reliant) on…
M2tM
  • 4,415
  • 1
  • 34
  • 43
-1
votes
1 answer

Serializable Object with Cereal

I have an abstract class BaseProduct that is inherited by classes like ConcreteProduct. I want all children classes to be forced to implement the serealize method for the cereal lib. I cant declare serialize as virtual because it should be a…
Ivan
  • 1,352
  • 2
  • 13
  • 31
-1
votes
2 answers

Serialization and inheritance in Cereal

I would like my program to save and read a Config structure in a JSON file. However, I have a problem with generating the correct JSON file. Probably the problem is inheritance. JSON Output (Incorrect): { "config": { …
Michał Hanusek
  • 199
  • 3
  • 13
-1
votes
2 answers

Best way to proceed to send data over UDP having the data format given (doubles, floats, ints, 1 bit bools) in C++/Visual Studio? Serialization?

I have the data, which includes 32 bit scaled integers for latitude and longitude,32 bit floats for x y and z velocity and some 1-bit flags. I also am successfully sending at least one double over UDP but it appears to be trash on the other end and…
1 2 3
8
9