Below is example code wherein i'm trying to do serialization using boost. For struct my_type serialize method is implementated but how do i serialize my_time and data_type as bcoz they are in different namespace
// MyData.hpp
namespace X { namespace Y {
struct my_type
{
std::string a;
double b;
private:
friend class boost::serialization::access;
template<class Archive>
void serialize(Archive &ar, const unsigned int version)
{
ar & a;
ar & b;
}
public:
my_type();
my_type(const parameter_strings & parms);
virtual ~my_type();
};
namespace Z
{
typedef unsigned int my_time;
typedef std::string data_type;
}
}
}
//MyData.cpp
#include <MyData.hpp>
my_type:: my_type()
{
}
my_type::~ my_type()
{
}
my_type:: my_type(const parameter_strings & parms)
{
// implemetation
}
Since my_time and data_type are not inside any class or struct hence i don't how do serialize it. what way i should serialize my_time and data_type in MyData.cpp file and if there is an it will be really helpful.
Thanks