Tags "serialization" Result

boost library serialization not working

I used macports to download and install boost lib without any problems. I tried to run the code from their website and got the following novel: c -c -o Main.o Main.cpp Compiling... g -o VectorSjov Main.o utunity/math/vector/Vec2d.cpp Undefined symbols for architecture x86_64: "boost::serialization::void_upcast(boost::serialization::ex

it1352 0 2020-09-22

Boost Polygon Serialization

I am using boost geometry in my project, and I need to serialize polygons. I have been using boost serialization without problems for many boost data types, but boost geometry seems that currently does not support serialization, as I cannot find any header inside serialization folder. Is there any well known method to achieve this? Thanks. EDIT:

it1352 5 2019-05-09

Datacontract serialization/serialization with images

I have a class with an image that has to be (sometimes) serialized/deserialized according to the fact that the image is embedded or not. [DataContract(IsReference = true)] public class Data { [DataContract(IsReference = true)] public class MyImage { [DataMember] int WidthStorage [DataMember] int HeightStorage; [DataMember] publ

it1352 4 2019-05-21

How to lock serialization in Java?

I am just starting with Java serialization: I have one exercise to do and I need to lock serialization on any class, it is suppose to throw an exception when I attempt to serialize that class. Does anyone know how to do it? Solution If you add an implementation of writeObject which throws an exception, serialization will be aborted, e.g. priva

it1352 2 2019-05-22

C Boost.Serialization error for hash_map with custom objects as key

I need to serialize an object that include an hash_map with another object as key. The object that is used as key is a base class for other objects. I have implemented the serialize() method in the base class and in derived classes, and each derived class inherits the serialization method of the base class. The situation is similar to this: #inclu

it1352 26 2019-05-09

Problems deserializing a pointer to a derived class using Boost:serialize

I have a weird problem trying to deserialize a pointer to a derived class with boost serialize. I have a base and derived with save/load function outside them (non intrusive version) but each time I try to deserialize a pointer I get either "Input Stream Error" exception or "Unregistered class" exception. Here is what I do: First I define my class

it1352 19 2019-05-09

How to serialize boost::rational

I cannot serialize boost::rational<int>. I searched for a boost/serialize/rational.h header but it does not exist. /usr/include/boost/serialization/access.hpp:118:9: error: ‘class boost::rational<int>’ has no member named ‘serialize’ Is there a way to achieve it? Solution Just serialize the numerator and denominator. Here's the le

it1352 4 2019-05-09