boost-serialization

Exceptions not passed correctly thru RCF (using Boost.Serialization)

I use RCF with boost.serialization (why use RCF's copy when we already use the original?) It works OK, but when an exception is thrown in the server, it's not passed correctly to the client. Instead, I get an RCF::SerializationException quoting an archive_exception saying "class name too long". When I change the protocol to BsText, the e...

Boost serialization: specifying a template class version

I have a template class that I serialize (call it C), for which I want to specify a version for boost serialization. As BOOST_CLASS_VERSION does not work for template classes. I tried this: namespace boost { namespace serialization { template< typename T, typename U > struct version< C<T,U> > { typedef mpl::int_<1> t...

C++ Boost ptr_map serialization error

I have some code that I want to build. The code uses boost::ptr_map class to serialize certain objects. I have Visual Studio 2008 with boost1.38 and I am getting following error from compiler. I wonder if any one else has seen any thing like this. C2039: 'serialize' : is not a member of 'boost::ptr_map' Looks like some reference is mis...

Should I be leery of using boost::archive?

I want to use boost::archive::iterators::base64_from_binary. But I can't seem to figure out why it is under "archive." What does this imply? Should I be leery of using this code for any reason? Thanks-- ...

Boost serialization problem

Hi everyone, i have situation like this: class IData { virtual void get() = 0; virtual void set() = 0; } BOOST_ASSUME_IS_ABSTRACT(IData) BOOST_EXPORT_CLASS(IData) template<typename T> class ConcreteData : public IData { public: protected: template<typename Archive> void serialize(Archive& ar, const unsigned version) { ar &...

Anyone used Boost SERIALIZATION with Codegear Builder 2009 Successfully

If you have been successful in persisting your data, which type of stream did you get to work Text or Binary ANSI or UNICODE Did you have to use any BOOST_ASSERTS or some extra MACRO or dance around the fairy ring at 4:00 am wearing your Moose sweater backwards. Thanks for your answer ...

Boost serialization performance: text vs. binary format

Hello! Should I prefer binary serialization over text serialization if performance is an issue ? Does anybody tested it on a large amount of data ? ...

boost serialization vs google protocol buffers?

Does anyone with experience with these libraries have any comment on which one they preferred? Were there any performance differences or difficulties in using? ...

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); oa.register_type<SomeClass>(); oa << boost::serialization::make_nvp("b",b); } Output will be li...

Boost::Archive causing weird linker error.

Does anyone have a clue why those two lines would cause that linker error? std::ifstream ifs("filename.file"); boost::archive::binary_iarchive iarchv( ifs ); Error 8 fatal error LNK1104: cannot open file 'F:\dev\project\build\win32-unit\tests\Debug\framework_core_tests.lib' ramework_core_tests framework_core_tests T...

How to use array optimization in boost serialization

I have to serialize an object that contains a std::vector that can contain thousand of members, with that vector sizes the serialization doesn't scale well. According with the documentation, Boost provides a wrapper class array that wraps the vector for optimizations but it generates the same xml output. Diving in boost code, i've found...

boost serialization access to protected data

Hi, When I try to serialize class with protected members, I get the following errors: "cannot access protected member declared in class NetElement". The idea is that I'd like to have one serialization function outside of class definition. What am I doing wrong? best regards, mightydodol Here is the code... // class definition clas...

How to hook up Boost serialization & iostreams to serialize & gzip an object to string?

Hi all; I've been using the Boost serialization library, which is actually pretty nice, and lets me make simple wrappers to save my serializable objects to strings, like so: template <class T> inline std::string saveString(const T & o) { std::ostringstream oss; boost::archive::binary_oarchive oa(oss); oa << o; return oss.str(); } te...

serialise nested unordered maps

Dear StackOverFlowers, I've got a variable with a declaration that looks like boost::unordered_map< std::string, boost::unordered_map <long,int>, hashe::fnv_1a> _pl; I need to serialise this to a file and and deserialise later. Should I just do a nested loop or can i do something ultracool with boost::serialisation? Any help pointing...

How to serialize shared/weak pointers?

I have a complex network of objects connected with QSharedPointers and QWeakPointers. Is there a simple way to save/load them with Boost.Serialization? So far I have this: namespace boost { namespace serialization { template<class Archive, class T> void save(Archive& ar, QSharedPointer<T> const& ptr, unsigned version...

How to flush file buffers when using boost::serialization?

I'm saving a file on an USB drive and need to make sure that it's completely written to avoid corruption in case the USB drive is not removed properly. Well I've done some research and it seems this is possible via calling the FlushFileBuffers Win32 function. But the problem is, I'm saving using boost::serialization and thus don't have a...

Why doesn't boost::serialization check for tag names in XML archives?

I'm starting to use boost::serialization on XML archives. I can produce and read data, but when I hand-modify the XML and interchange two tags, it "fails to fail" (i.e. it proceeds happily). Here's a small, self-complete example showing what I see: #include <iostream> #include <fstream> #include <boost/archive/xml_oarchive.hpp> #includ...

Serialization over Pipes

I wrote several simulation programs in C++ and want to connect their outputs/inputs with pipes (best solution would probably be to use the C++ streams). For this I would like to serialize some objects (for example the simulations output/input are tensors and matrices). How should I handle this problem? I searched around for some time fo...

boost.serialization and lazy initialization

i need to serialize directory tree. i have no trouble with this type: std::map< std::string, // string(path name) std::vector<std::string> // string array(file names in the path) > tree; but for the serialization the directory tree with the content i need other type: std::map< std::string, // string(path name) std::vector...

Compilation error when using boost serialization library

I have been struggling with this error for a long time. The following is my code snippet. //This is the header file template<typename TElem> class ArrayList { public: /** An accessible typedef for the elements in the array. */ typedef TElem Elem; friend class boost::serialization::access; template<class Archive> void se...