-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathModuleSet.cpp
More file actions
40 lines (38 loc) · 1.28 KB
/
ModuleSet.cpp
File metadata and controls
40 lines (38 loc) · 1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#include "ModuleSet.h"
template<class Archive> void ModuleSet::serialize(Archive & ar, const unsigned int /* file_version */)
{
ar & BOOST_SERIALIZATION_NVP(Modules);
//& BOOST_SERIALIZATION_NVP(Scans);
}
void saveModuleSetXML(const ModuleSet &s, const char * filename){ //from example code
// make an archive
std::ofstream ofs(filename);
assert(ofs.good());
boost::archive::xml_oarchive oa(ofs);
oa << BOOST_SERIALIZATION_NVP(s);
}
void loadModuleSetXML(ModuleSet &s, const char * filename) //from example code
{
// open the archive
std::ifstream ifs(filename);
assert(ifs.good());
boost::archive::xml_iarchive ia(ifs);
// restore the schedule from the archive
ia >> BOOST_SERIALIZATION_NVP(s);
}
void saveModuleSetBIN(const ModuleSet &s, const char * filename){ //from example code
// make an archive
std::ofstream ofs(filename);
assert(ofs.good());
boost::archive::binary_oarchive oa(ofs);
oa << BOOST_SERIALIZATION_NVP(s);
}
void loadModuleSetBIN(ModuleSet &s, const char * filename) //from example code
{
// open the archive
std::ifstream ifs(filename);
assert(ifs.good());
boost::archive::binary_iarchive ia(ifs);
// restore the schedule from the archive
ia >> BOOST_SERIALIZATION_NVP(s);
}