Questions tagged [boost-serialization]

Boost.Serialization is a cross-platform C++ serialization library.

Boost.Serialization is a cross-platform C++ serialization library. Here, we use the term "serialization" to mean the reversible deconstruction of an arbitrary set of C++ data structures to a sequence of bytes. Such a system can be used to reconstitute an equivalent structure in another program context. Depending on the context, this might be used to implement object persistence, remote parameter passing or other facility. In this system we use the term "archive" to refer to a specific rendering of this stream of bytes. This could be a file of binary data, text data, XML, or some other created by the user of this library.

Boost.Serialization goals:

  1. Code portability - depend only on ANSI C++ facilities.
  2. Code economy - exploit features of C++ such as RTTI, templates, and multiple inheritance, etc. where appropriate to make code shorter and simpler to use.
  3. Independent versioning for each class definition. That is, when a class definition changed, older files can still be imported to the new version of the class.
  4. Deep pointer save and restore. That is, save and restore of pointers saves and restores the data pointed to.
  5. Proper restoration of pointers to shared data.
  6. Serialization of STL containers and other commonly used templates.
  7. Data Portability - Streams of bytes created on one platform should be readable on any other.
  8. Orthogonal specification of class serialization and archive format. That is, any file format should be able to store serialization of any arbitrary set of C++ data structures without having to alter the serialization of any class.
  9. Non-intrusive. Permit serialization to be applied to unaltered classes. That is, don't require that classes to be serialized be derived from a specific base class or implement specified member functions. This is necessary to easily permit serialization to be applied to classes from class libraries that we cannot or don't want to have to alter.
  10. The archive interface must be simple enough to easily permit creation of a new type of archive.
  11. The archive interface must be rich enough to permit the creation of an archive that presents serialized data as XML in a useful manner.
448 questions
0
votes
1 answer

Linker error when using Boost::Serialization in XCode

I am trying to build a demo from the Boost::Serialization page: #include #include #include class gps_position { private: friend class boost::serialization::access; …
Adrian
  • 19,440
  • 34
  • 112
  • 219
0
votes
0 answers

Linker error with boost serialization: missing lib file

I have VC 10 and using boost 1.53.0. I am trying to compile and link a sample program from boost serialization samples, but the linker generates the following error: LINK : fatal error LNK1104: cannot open file…
Nasir
  • 11
  • 1
0
votes
0 answers

error C2995: function tmeplate has already been defined

I referenced error C2995: function template has already been defined but it was not clear to me how my compile-time errors could be resolved. I did not discover any circular references and thus I would like to understand why the compiler generates…
Mushy
  • 2,535
  • 10
  • 33
  • 54
0
votes
1 answer

boost serialization run-time error with strings in windows

We are testing a very simple serialization code with boost::serialization. The test simply writes a std::string in a file. It compiles ok but the problem is that it throws an exception when << operator is called. The file remains empty. Unhandled…
0
votes
2 answers

How to iterate over archive in boost::serialization

I loaded multiple data into boost::archive::text_oarchive, now I need to extract the data. But because the archive contains multiple records, I would need an iterator. something like //input archive boost::archive::text_iarchive iarch(ifs); //read…
Vyacheslav
  • 113
  • 1
  • 9
0
votes
1 answer

load_construct_data in boost: problems with placement new

I try to serialize derived pointer class with non-default constructor with the help of boost. During the compilation I get an error: Derived.h: In function ‘void boost::serialization::load_construct_data(Archive&, const A::Derived*, unsigned…
0
votes
1 answer

serialize is not a member of std::unique_ptr

Is this question more appropriate for Boost forums? The complete code is referenced below and I do not consider that I have incorrectly attempted to convert an auto_ptr serialization example into a unique_ptr example as compared to other unique_ptr…
user633658
  • 2,463
  • 2
  • 18
  • 16
0
votes
1 answer

serialize pointer itself not the target object

I have a data class to be saved and loaded using boost serializer. The class includes two members En *sender, En *receiver to two objects that are already created in my system. I don't need them to be created again. I just need to send(serialize)…
rahman
  • 4,820
  • 16
  • 52
  • 86
0
votes
1 answer

Boost.Serialization Warning

Not sure what is causing the following warning which, as I read, can be safely ignored 32 bit: conversion from 'std::streamsize' to 'size_t', possible loss of data I am performing routine Boost serialization and the program is working great. The…
user633658
  • 2,463
  • 2
  • 18
  • 16
0
votes
1 answer

Boost C++ Serialization lib missing in xubuntu installation

I have xubuntu OS installed on my PC (12.04, Precise Pangolin) and installed C++ boost lib (1.49) using ubuntu's binary repository for boost by issuing the following command in the terminal: sudo apt-get install libboost-dev The command…
F. Aydemir
  • 2,665
  • 5
  • 40
  • 60
0
votes
0 answers

Is it possible to use boost to serialize and pretty-print polymorphic classes?

Is there a minimal way to use boost for marshalling/unmarshalling as well as pretty-printing structs with their field-names (RTTI?) ? It seems like you could use boost::fusion and then somehow automatically implement the boost::serialization…
Ross Rogers
  • 23,523
  • 27
  • 108
  • 164
0
votes
1 answer

boost serialization base class without base_object

I am using multiple inheritance with boost serialization. instead of doing boost::serialization::base_object< Connection >(*this) boost::serialization::base_object< Collection >(*this) I am doing template void…
Neel Basu
  • 12,638
  • 12
  • 82
  • 146
0
votes
1 answer

Serialization with a custom pattern and random access with Boost

I'm asking here because i have already tried to search but i have no idea if this things even exist and what their names are. I start explaining that with custom pattern i mean this: suppose that i need to serialize objects or data of type foo, bar…
user1802174
  • 273
  • 3
  • 10
0
votes
1 answer

class_id in boost::archive::xml_oarchive

Is it possible for XML serialization to use more human friendly class_id as GUID, described using BOOST_CLASS_EXPORT_GUID ??? Consider serializing class: SomeClass* b=new SomeClass("c"); { boost::archive::xml_oarchive oa(cout); …
Arpegius
  • 5,817
  • 38
  • 53
0
votes
2 answers

The Boost library, serialization, and an ampersand operator?

I come from a Java and C# background and as a way to dive into C++, I'm building an icons dock using Qt and Boost. Looking at the documentation for the serialization, I stumbled uppon some interesting use of an & operator. class…
Uri
  • 2,207
  • 2
  • 21
  • 21
1 2 3
29
30