8 #include <boost/date_time/gregorian/formatters.hpp>
10 #include <boost/archive/text_iarchive.hpp>
11 #include <boost/archive/text_oarchive.hpp>
12 #include <boost/serialization/access.hpp>
21 FlightDateKey::FlightDateKey()
30 : _flightNumber (iFlightNumber), _departureDate (iFlightDate) {
35 : _flightNumber (iKey._flightNumber), _departureDate (iKey._departureDate) {
44 ioOut <<
"FlightDateKey: " <<
toString();
53 std::ostringstream oStr;
54 const std::string& lDepartureDateStr =
55 boost::gregorian::to_iso_extended_string (_departureDate);
62 void FlightDateKey::serialisationImplementationExport()
const {
63 std::ostringstream oStr;
64 boost::archive::text_oarchive oa (oStr);
69 void FlightDateKey::serialisationImplementationImport() {
70 std::istringstream iStr;
71 boost::archive::text_iarchive ia (iStr);
76 template<
class Archive>
78 const unsigned int iFileVersion) {
83 std::string lDepartureDateStr =
84 boost::gregorian::to_simple_string (_departureDate);
85 ioArchive & _flightNumber & lDepartureDateStr;
90 namespace ba = boost::archive;
91 template void FlightDateKey::serialize<ba::text_oarchive> (ba::text_oarchive&,
93 template void FlightDateKey::serialize<ba::text_iarchive> (ba::text_iarchive&,
const std::string DEFAULT_KEY_SUB_FLD_DELIMITER
const Date_T DEFAULT_DEPARTURE_DATE
unsigned short FlightNumber_T
Handle on the StdAir library context.
void toStream(std::ostream &ioOut) const
Key of a given flight-date, made of a flight number and a departure date.
void fromStream(std::istream &ioIn)
void serialize(Archive &ar, const unsigned int iFileVersion)
boost::gregorian::date Date_T
const FlightNumber_T DEFAULT_FLIGHT_NUMBER
const std::string toString() const