[boost][serialization] How to implement serialization classes in two DLLs
Hi,
I'm very sorry to post the message hereafter a second time, but I've not
received any reply, maybe I've missed it.
Any workaround or recommendations will be welcome because we are right
now surrounded in our software development.
Thanks in advance.
Marc VIALA
After few hour on the subject, I'm would like to have some explanations
& recommendations one the boost serialization library. To explain, my
problem, you will find hereafter a VC++ 7.1 project that demonstrates
it.
Problem Description
We have involved in a large project with for example two DLLs libraries:
LibA and LibB. These libraries define & implement one class, let's say
libA::A and libB::B. These two classes can be serialized through boost
serialization engine.
The interfaces for the two classes are the same:
----------------------
struct LIBA_API A
{
std::vector<double> my_vector ;
private:
friend class boost::serialization::access;
template<class Archive>
void save(Archive & ar, const unsigned int version) const ;
template<class Archive>
void load(Archive & ar, const unsigned int version) ;
BOOST_SERIALIZATION_SPLIT_MEMBER()
};
LIBA_API
void save(const libA::A* pObj, std::ostream& os) ;
LIBA_API
void load(libA::A* &pObj, std::istream& is) ;
}; // Namespace libA
----------------------
The two free functions save() and load() are defined to be able to
serialize the class libA::A (respectively the class libB::B).
When, we try to use these interfaces in an EXE application:
----------------------
#include
Truth is I havn't gotten to it. Sorry. Its a very tricky area. One thing you might want to look at is the test which shows separate compilation. This avoids having the "same" code in both the executable and the dll which might help.
Robert Ramey
"Marc Viala"
Hi Robert,
Thanks to handle my request; Ive looked the source directory test and
examples of boost::serialization ver#1.33.1 and I didnt find the test
that youve pointed in your reply.
Whats the name of the test demonstrating separate compilation?
Marc Viala
mailto:mviala@acticm.com mailto:mviala@acticm.com
_____
De : boost-users-bounces@lists.boost.org
[mailto:boost-users-bounces@lists.boost.org] De la part de Robert Ramey
Envoyé : mercredi 1 février 2006 22:59
À : boost-users@lists.boost.org
Objet : Re: [Boost-users] [boost][serialization] How to
implementserializationclasses in two DLLs
Truth is I havn't gotten to it. Sorry. Its a very tricky area. One thing
you might want to look at is the test which shows separate compilation.
This avoids having the "same" code in both the executable and the dll which
might help.
Robert Ramey
"Marc Viala"
participants (3)
-
Marc Viala
-
Marc VIALA
-
Robert Ramey