Boost logo

Boost Users :

From: kauai (kauai_diver_at_[hidden])
Date: 2005-05-08 00:23:13


Hi all,

I have a container class that has a vector which contains
several other classes. My container class has a serialize
function that looks like this:

friend class boost::serialization::access;
template<class Archive> void serialize (Archive &ar, const
unsigned int version)
{
   // save/load base class information
   ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(MyBaseClass);
   ar.register_type(static_cast<SomeClass1*>(NULL));
   ar.register_type(static_cast<SomeClass2*>(NULL));
...
   ar & BOOST_SERIALIZATION_NVP(m_Vector); // std::vector
}

Got everything working but now an issue has come up:
Someone wants to add a new class but it is not part of this
package that is doing the serialzation. I want to avoid
what I call "dependency hell", is there a way for that new
class to get registered someplace other than in this
function?

Thanks for any help,
Kauai

                
Discover Yahoo!
Stay in touch with email, IM, photo sharing and more. Check it out!
http://discover.yahoo.com/stayintouch.html


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net