Classification: Honeywell Internal

All serialize methods (except the base class serialize method) have as their first three lines code like this (with the appropriate

 

   BOOST_LOG_TRIVIAL(trace) << CLASS_METHOD << "  called";
   boost::serialization::void_cast_register<derivedbase>(
      static_cast<derived *>(nullptr),
      static_cast<base *>(nullptr)
      ); 
   ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(base);

 

 

If that’s what you’re referring to, it didn’t fix the problem

---

Steve H.

 

============================================================================================================================================================================================================
This message classified as
Honeywell Internal by Hickman, Steve (AdvTech) on Tuesday, June 03, 2014 at 3:34:21 AM.
The above classification labels are in accordance with the Honeywell Corporate Classification Policy. The information contained in this electronic message is confidential and intended only for the use of the individual/entity named above, and the information may be privileged. If you, the reader of this message, are not the intended recipient or an employee or agent responsible to deliver this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please immediately notify the sender and delete the original message.
============================================================================================================================================================================================================

From: Robert Ramey [mailto:robertmacleranramey@gmail.com]
Sent: Sunday, June 01, 2014 11:22 AM
To: boostusers@googlegroups.com
Cc: robertmacleranramey@gmail.com; boost-users@lists.boost.org; Hickman, Steve (AdvTech)
Subject: Re: [Boost-users] [serialization] deserialized instance empty even though proper serialize methods called

 



On Saturday, May 31, 2014 2:50:35 PM UTC-7, Robert Ramey wrote:

 

I woke up in the middle of the night.

 

The "registration" base/derived pair is a side effect of 

 

class Base {

    virtual~Base();

    template<class Archive);

    void serialize(Archive ar, const unsigned int version);

};

 

class Derived {

    virtual~Derived();

    template<class Archive);

    void serialize(Archive ar, const unsigned int version);

};

 

template<class Archive);

void Derived::serialize(Archive ar, const unsigned int version){

   ar & boost::serialization::base_object<Base &>( *this);   // side effect void_cast_register(Base, Derived) which updates the table when DLL is loaded

}

 

So I'm guessing that you're not calling the base class serialization so the Base/Derived pair isn't being registered.

 

Solution:

 

explicitly declare, define and call the Base class serialization even though it is empty.

 

or

 

explicitly invoke register void_cast::register base/derived - i forget the exact name.

 

I'll be surprised if that doesn't solve your problem.

 

RObert Ramey