Boost logo

Boost Users :

Subject: Re: [Boost-users] Pointer serialization and deserialization
From: Robert Ramey (ramey_at_[hidden])
Date: 2009-03-10 03:35:26

Sorry, I can't see anything wrong with it.

Robert Ramey
  "niranjan bangera" <niranjannina_at_[hidden]> wrote in message

  Yes the pointer is been initialized by NULL in the constructor of the class of that pointer.


  Do you know for a fact that the pointer has been initialized?

  Robert Ramey
    "niranjan bangera" <niranjannina_at_...> wrote in message news:50a2f6f20903090457n37c0bfb2n3eec9d716a56c84c_at_......
    Hi all,


    I am trying to serialize and deserialize a pointer to the class, but ended with the segmentation fault, Is that the null pointer serialization gives the segmentation fault?. I read in document that, library will maintain the Null pointer. if not how can i serialize? ,any docs or related refference is a;so acceptable. Thanks in advance....

    one more thing: what -1 in archive(text_archive) indicates?


    #include <fstream>
       #include "boost/archive/text_iarchive.hpp"
       #include "boost/archive/text_oarchive.hpp"
      #include "boost/serialization/access.hpp"
      #include "boost/serialization/assume_abstract.hpp"

    class Dkpt


      friend class boost::serialization::access;
        template<class Archive>
        void serialize(Archive & ar, const unsigned int file_version)
           (void) file_version;
              ar & data_;
              ar & b_i;
              ar & f_er;
              ar & pa_er;
              ar & ct_c;

    uint8_t data_;
    bool b_i;
    bool f_er;
    bool pa_er;
    bool ct_c;


    class RB : public RM

      virtual void checkpoint_save(boost::archive::text_oarchive & oa)
         oa & dr;

      virtual void checkpoint_retrive(boost::archive::text_iarchive & ia)
         ia & dr;


     Dkpt* dr;




  Boost-users mailing list

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at