Take the following simple use of serialization:
//===============================================
#include
#include
#include
#include
#include
#include
#include <fstream>
#include
class Defs {
public:
Defs(const std::string& f) : fileName_(f) {}
Defs() {}
bool operator==(const Defs& rhs) const { return fileName_ ==
rhs.fileName_;}
const std::string& fileName() { return fileName_;}
private:
std::string fileName_;
friend class boost::serialization::access;
template<class Archive>
void serialize(Archive & ar, const unsigned int /*version*/) {
ar & fileName_;
}
};
int main()
{
Defs saveDefs("saveFile.txt");
{
// Save the defs file
std::ofstream ofs( saveDefs.fileName().c_str() );
boost::archive::text_oarchive oa( ofs );
oa << saveDefs;
}
{
// Restore the defs file
Defs loadDefs;
std::ifstream ifs(saveDefs.fileName().c_str());
boost::archive::text_iarchive ia(ifs);
ia >> loadDefs;
assert( saveDefs == loadDefs );
}
return 0;
}
//===============================================
This produces the following messages from the AIX v10.1 compiler.
vacpp.compile.c++ bin/vacpp/debug/src/TestSerialisation.o
"/s1a/emos_esuite/emos_data/sms/boost_1_39_0/boost/archive/detail/oserializer.hpp",
line 538.5: 1540-2400 (W) "boost::serialization::STATIC_WARNING" is
undefined. The delete operator will not call a destructor.
"/s1a/emos_esuite/emos_data/sms/boost_1_39_0/boost/archive/detail/oserializer.hpp",
line 530.13: 1540-0700 (I) The previous message was produced while
processing
"boost::archive::saveboost::archive::text_oarchive,Defs(text_oarchive &,
Defs &)".
"/s1a/emos_esuite/emos_data/sms/boost_1_39_0/boost/archive/detail/common_oarchive.hpp",
line 64.9: 1540-0700 (I) The previous message was produced while processing
"boost::archive::detail::common_oarchiveboost::archive::text_oarchive::save_override<Defs>(Defs
&, int)".
"/s1a/emos_esuite/emos_data/sms/boost_1_39_0/boost/archive/basic_text_oarchive.hpp",
line 75.13: 1540-0700 (I) The previous message was produced while processing
"boost::archive::basic_text_oarchiveboost::archive::text_oarchive::save_override<Defs>(Defs
&, int)".
"/s1a/emos_esuite/emos_data/sms/boost_1_39_0/boost/archive/detail/interface_oarchive.hpp",
line 64.21: 1540-0700 (I) The previous message was produced while processing
"boost::archive::detail::interface_oarchiveboost::archive::text_oarchive::operator<<
<Defs>(Defs &)"
Does anyone know if the boost serialisation library is still actively
maintained on this compiler ?
Best regards,
Ta,
Avi