"Dinesh Kumar R" wrote in message
news:e752274c0811270508i3f0b6255udfdb31560f6ea74a@mail.gmail.com...
Hi Guyz,
Can you please tell me how to turn off the following in Boost Serailization?
I dont need the following in my document.
<!DOCTYPE boost_serialization>
Use "no_header" flag when you open the archive.
How do I Serialize an array of Object?
eg:
class simulated_defects
{
friend class boost::serialization::access;
// friend std::ostream & operator<<(std::ostream &os, const
simulated_defects &gp);
public:
int defect_num[10];
int defect_pos;
int defect_area;
float defect_type;
template<class Archive>
void serialize(Archive & ar, const unsigned int /* file_version */){
ar & BOOST_SERIALIZATION_NVP(defect_num)
& BOOST_SERIALIZATION_NVP(defect_pos)
& BOOST_SERIALIZATION_NVP(defect_area)
& BOOST_SERIALIZATION_NVP(defect_type);
}
};
simulated_defects object[10]; to serialize array of object , I need a
wrapper to define this object inside a class and then serailize, is there
any straight forward method? If i use loop to serialize the Headers at the
top of xml file is inserted at start of each loop?
use:
simulated_defects objectst[10];
...
ar << objects;
Robert Ramey