diff options
Diffstat (limited to '3rdParty/Boost/src/boost/date_time/posix_time')
14 files changed, 215 insertions, 14 deletions
diff --git a/3rdParty/Boost/src/boost/date_time/posix_time/conversion.hpp b/3rdParty/Boost/src/boost/date_time/posix_time/conversion.hpp index 3fb21d7..83ccf60 100644 --- a/3rdParty/Boost/src/boost/date_time/posix_time/conversion.hpp +++ b/3rdParty/Boost/src/boost/date_time/posix_time/conversion.hpp @@ -6,7 +6,7 @@ * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland, Bart Garst - * $Date: 2010-06-09 14:10:13 -0400 (Wed, 09 Jun 2010) $ + * $Date: 2010-06-09 11:10:13 -0700 (Wed, 09 Jun 2010) $ */ #include <cstring> diff --git a/3rdParty/Boost/src/boost/date_time/posix_time/date_duration_operators.hpp b/3rdParty/Boost/src/boost/date_time/posix_time/date_duration_operators.hpp index e6899ba..6846a77 100644 --- a/3rdParty/Boost/src/boost/date_time/posix_time/date_duration_operators.hpp +++ b/3rdParty/Boost/src/boost/date_time/posix_time/date_duration_operators.hpp @@ -6,7 +6,7 @@ * (See accompanying file LICENSE_1_0.txt or * http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland, Bart Garst - * $Date: 2008-02-27 15:00:24 -0500 (Wed, 27 Feb 2008) $ + * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $ */ #include "boost/date_time/gregorian/greg_duration_types.hpp" diff --git a/3rdParty/Boost/src/boost/date_time/posix_time/posix_time.hpp b/3rdParty/Boost/src/boost/date_time/posix_time/posix_time.hpp index 4e9294c..3b85ff4 100644 --- a/3rdParty/Boost/src/boost/date_time/posix_time/posix_time.hpp +++ b/3rdParty/Boost/src/boost/date_time/posix_time/posix_time.hpp @@ -6,7 +6,7 @@ * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland, Bart Garst - * $Date: 2008-02-27 15:00:24 -0500 (Wed, 27 Feb 2008) $ + * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $ */ /*!@file posix_time.hpp Global header file to get all of posix time types */ diff --git a/3rdParty/Boost/src/boost/date_time/posix_time/posix_time_config.hpp b/3rdParty/Boost/src/boost/date_time/posix_time/posix_time_config.hpp index 60c3f7e..d0b7653 100644 --- a/3rdParty/Boost/src/boost/date_time/posix_time/posix_time_config.hpp +++ b/3rdParty/Boost/src/boost/date_time/posix_time/posix_time_config.hpp @@ -6,7 +6,7 @@ * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland, Bart Garst - * $Date: 2009-06-04 07:52:28 -0400 (Thu, 04 Jun 2009) $ + * $Date: 2012-10-10 12:05:03 -0700 (Wed, 10 Oct 2012) $ */ #include <cstdlib> //for MCW 7.2 std::abs(long long) @@ -81,7 +81,7 @@ namespace posix_time { {} //Give duration access to ticks constructor -- hide from users friend class date_time::time_duration<time_duration, time_res_traits>; - private: + protected: explicit time_duration(impl_type tick_count) : date_time::time_duration<time_duration, time_res_traits>(tick_count) {} diff --git a/3rdParty/Boost/src/boost/date_time/posix_time/posix_time_duration.hpp b/3rdParty/Boost/src/boost/date_time/posix_time/posix_time_duration.hpp index db3b85f..9778fd7 100644 --- a/3rdParty/Boost/src/boost/date_time/posix_time/posix_time_duration.hpp +++ b/3rdParty/Boost/src/boost/date_time/posix_time/posix_time_duration.hpp @@ -6,7 +6,7 @@ * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland - * $Date: 2008-02-27 15:00:24 -0500 (Wed, 27 Feb 2008) $ + * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $ */ #include "boost/date_time/posix_time/posix_time_config.hpp" diff --git a/3rdParty/Boost/src/boost/date_time/posix_time/posix_time_io.hpp b/3rdParty/Boost/src/boost/date_time/posix_time/posix_time_io.hpp index 9a80737..fb63a91 100644 --- a/3rdParty/Boost/src/boost/date_time/posix_time/posix_time_io.hpp +++ b/3rdParty/Boost/src/boost/date_time/posix_time/posix_time_io.hpp @@ -6,7 +6,7 @@ * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland, Bart Garst - * $Date: 2008-11-13 14:05:31 -0500 (Thu, 13 Nov 2008) $ + * $Date: 2008-11-13 11:05:31 -0800 (Thu, 13 Nov 2008) $ */ #include <locale> diff --git a/3rdParty/Boost/src/boost/date_time/posix_time/posix_time_legacy_io.hpp b/3rdParty/Boost/src/boost/date_time/posix_time/posix_time_legacy_io.hpp index f5b20a8..fcc3fac 100644 --- a/3rdParty/Boost/src/boost/date_time/posix_time/posix_time_legacy_io.hpp +++ b/3rdParty/Boost/src/boost/date_time/posix_time/posix_time_legacy_io.hpp @@ -6,7 +6,7 @@ * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland, Bart Garst - * $Date: 2008-02-27 15:00:24 -0500 (Wed, 27 Feb 2008) $ + * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $ */ /*! @file posix_time_pre133_operators.hpp diff --git a/3rdParty/Boost/src/boost/date_time/posix_time/posix_time_system.hpp b/3rdParty/Boost/src/boost/date_time/posix_time/posix_time_system.hpp index 3d44e0f..13626e9 100644 --- a/3rdParty/Boost/src/boost/date_time/posix_time/posix_time_system.hpp +++ b/3rdParty/Boost/src/boost/date_time/posix_time/posix_time_system.hpp @@ -6,7 +6,7 @@ * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland - * $Date: 2008-02-27 15:00:24 -0500 (Wed, 27 Feb 2008) $ + * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $ */ diff --git a/3rdParty/Boost/src/boost/date_time/posix_time/ptime.hpp b/3rdParty/Boost/src/boost/date_time/posix_time/ptime.hpp index 2abc02d..3f1cb04 100644 --- a/3rdParty/Boost/src/boost/date_time/posix_time/ptime.hpp +++ b/3rdParty/Boost/src/boost/date_time/posix_time/ptime.hpp @@ -6,7 +6,7 @@ * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland - * $Date: 2008-02-27 15:00:24 -0500 (Wed, 27 Feb 2008) $ + * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $ */ #include "boost/date_time/posix_time/posix_time_system.hpp" diff --git a/3rdParty/Boost/src/boost/date_time/posix_time/time_formatters.hpp b/3rdParty/Boost/src/boost/date_time/posix_time/time_formatters.hpp index 466331b..534b952 100644 --- a/3rdParty/Boost/src/boost/date_time/posix_time/time_formatters.hpp +++ b/3rdParty/Boost/src/boost/date_time/posix_time/time_formatters.hpp @@ -6,7 +6,7 @@ * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland, Bart Garst - * $Date: 2010-01-10 14:17:23 -0500 (Sun, 10 Jan 2010) $ + * $Date: 2010-01-10 11:17:23 -0800 (Sun, 10 Jan 2010) $ */ #include <boost/date_time/gregorian/gregorian.hpp> diff --git a/3rdParty/Boost/src/boost/date_time/posix_time/time_formatters_limited.hpp b/3rdParty/Boost/src/boost/date_time/posix_time/time_formatters_limited.hpp index d0e959e..8d2ebdc 100644 --- a/3rdParty/Boost/src/boost/date_time/posix_time/time_formatters_limited.hpp +++ b/3rdParty/Boost/src/boost/date_time/posix_time/time_formatters_limited.hpp @@ -6,7 +6,7 @@ * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland, Bart Garst - * $Date: 2010-01-10 14:17:23 -0500 (Sun, 10 Jan 2010) $ + * $Date: 2010-01-10 11:17:23 -0800 (Sun, 10 Jan 2010) $ */ #include <boost/date_time/gregorian/gregorian.hpp> diff --git a/3rdParty/Boost/src/boost/date_time/posix_time/time_parsers.hpp b/3rdParty/Boost/src/boost/date_time/posix_time/time_parsers.hpp index 8a352f6..3dc02b1 100644 --- a/3rdParty/Boost/src/boost/date_time/posix_time/time_parsers.hpp +++ b/3rdParty/Boost/src/boost/date_time/posix_time/time_parsers.hpp @@ -6,7 +6,7 @@ * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland - * $Date: 2008-02-27 15:00:24 -0500 (Wed, 27 Feb 2008) $ + * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $ */ #include "boost/date_time/gregorian/gregorian.hpp" diff --git a/3rdParty/Boost/src/boost/date_time/posix_time/time_period.hpp b/3rdParty/Boost/src/boost/date_time/posix_time/time_period.hpp index cb7bf07..11f8120 100644 --- a/3rdParty/Boost/src/boost/date_time/posix_time/time_period.hpp +++ b/3rdParty/Boost/src/boost/date_time/posix_time/time_period.hpp @@ -6,7 +6,7 @@ * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland - * $Date: 2008-02-27 15:00:24 -0500 (Wed, 27 Feb 2008) $ + * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $ */ #include "boost/date_time/period.hpp" diff --git a/3rdParty/Boost/src/boost/date_time/posix_time/time_serialize.hpp b/3rdParty/Boost/src/boost/date_time/posix_time/time_serialize.hpp new file mode 100644 index 0000000..c9038f1 --- /dev/null +++ b/3rdParty/Boost/src/boost/date_time/posix_time/time_serialize.hpp @@ -0,0 +1,201 @@ +#ifndef POSIX_TIME_SERIALIZE_HPP___ +#define POSIX_TIME_SERIALIZE_HPP___ + +/* Copyright (c) 2004-2005 CrystalClear Software, Inc. + * Use, modification and distribution is subject to the + * Boost Software License, Version 1.0. (See accompanying + * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) + * Author: Jeff Garland, Bart Garst + * $Date: 2012-09-30 16:25:22 -0700 (Sun, 30 Sep 2012) $ + */ + +#include "boost/date_time/posix_time/posix_time.hpp" +#include "boost/date_time/gregorian/greg_serialize.hpp" +#include "boost/serialization/split_free.hpp" +#include "boost/serialization/nvp.hpp" + + +// macros to split serialize functions into save & load functions +// NOTE: these macros define template functions in the boost::serialization namespace. +// They must be expanded *outside* of any namespace +BOOST_SERIALIZATION_SPLIT_FREE(boost::posix_time::ptime) +BOOST_SERIALIZATION_SPLIT_FREE(boost::posix_time::time_duration) +BOOST_SERIALIZATION_SPLIT_FREE(boost::posix_time::time_period) + +namespace boost { +namespace serialization { + + +/*** time_duration ***/ + +//! Function to save posix_time::time_duration objects using serialization lib +/*! time_duration objects are broken down into 4 parts for serialization: + * types are hour_type, min_type, sec_type, and fractional_seconds_type + * as defined in the time_duration class + */ +template<class Archive> +void save(Archive & ar, + const posix_time::time_duration& td, + unsigned int /*version*/) +{ + // serialize a bool so we know how to read this back in later + bool is_special = td.is_special(); + ar & make_nvp("is_special", is_special); + if(is_special) { + std::string s = to_simple_string(td); + ar & make_nvp("sv_time_duration", s); + } + else { + posix_time::time_duration::hour_type h = td.hours(); + posix_time::time_duration::min_type m = td.minutes(); + posix_time::time_duration::sec_type s = td.seconds(); + posix_time::time_duration::fractional_seconds_type fs = td.fractional_seconds(); + ar & make_nvp("time_duration_hours", h); + ar & make_nvp("time_duration_minutes", m); + ar & make_nvp("time_duration_seconds", s); + ar & make_nvp("time_duration_fractional_seconds", fs); + } +} + +//! Function to load posix_time::time_duration objects using serialization lib +/*! time_duration objects are broken down into 4 parts for serialization: + * types are hour_type, min_type, sec_type, and fractional_seconds_type + * as defined in the time_duration class + */ +template<class Archive> +void load(Archive & ar, + posix_time::time_duration & td, + unsigned int /*version*/) +{ + bool is_special = false; + ar & make_nvp("is_special", is_special); + if(is_special) { + std::string s; + ar & make_nvp("sv_time_duration", s); + posix_time::special_values sv = gregorian::special_value_from_string(s); + td = posix_time::time_duration(sv); + } + else { + posix_time::time_duration::hour_type h(0); + posix_time::time_duration::min_type m(0); + posix_time::time_duration::sec_type s(0); + posix_time::time_duration::fractional_seconds_type fs(0); + ar & make_nvp("time_duration_hours", h); + ar & make_nvp("time_duration_minutes", m); + ar & make_nvp("time_duration_seconds", s); + ar & make_nvp("time_duration_fractional_seconds", fs); + td = posix_time::time_duration(h,m,s,fs); + } +} + +// no load_construct_data function provided as time_duration provides a +// default constructor + +/*** ptime ***/ + +//! Function to save posix_time::ptime objects using serialization lib +/*! ptime objects are broken down into 2 parts for serialization: + * a date object and a time_duration onject + */ +template<class Archive> +void save(Archive & ar, + const posix_time::ptime& pt, + unsigned int /*version*/) +{ + // from_iso_string does not include fractional seconds + // therefore date and time_duration are used + posix_time::ptime::date_type d = pt.date(); + ar & make_nvp("ptime_date", d); + if(!pt.is_special()) { + posix_time::ptime::time_duration_type td = pt.time_of_day(); + ar & make_nvp("ptime_time_duration", td); + } +} + +//! Function to load posix_time::ptime objects using serialization lib +/*! ptime objects are broken down into 2 parts for serialization: + * a date object and a time_duration onject + */ +template<class Archive> +void load(Archive & ar, + posix_time::ptime & pt, + unsigned int /*version*/) +{ + // from_iso_string does not include fractional seconds + // therefore date and time_duration are used + posix_time::ptime::date_type d(posix_time::not_a_date_time); + posix_time::ptime::time_duration_type td; + ar & make_nvp("ptime_date", d); + if(!d.is_special()) { + ar & make_nvp("ptime_time_duration", td); + pt = boost::posix_time::ptime(d,td); + } + else { + pt = boost::posix_time::ptime(d.as_special()); + } + +} + +//!override needed b/c no default constructor +template<class Archive> +inline void load_construct_data(Archive & /*ar*/, + posix_time::ptime* pt, + const unsigned int /*file_version*/) +{ + // retrieve data from archive required to construct new + // invoke inplace constructor to initialize instance of date + new(pt) boost::posix_time::ptime(boost::posix_time::not_a_date_time); +} + +/*** time_period ***/ + +//! Function to save posix_time::time_period objects using serialization lib +/*! time_period objects are broken down into 2 parts for serialization: + * a begining ptime object and an ending ptime object + */ +template<class Archive> +void save(Archive & ar, + const posix_time::time_period& tp, + unsigned int /*version*/) +{ + posix_time::ptime beg(tp.begin().date(), tp.begin().time_of_day()); + posix_time::ptime end(tp.end().date(), tp.end().time_of_day()); + ar & make_nvp("time_period_begin", beg); + ar & make_nvp("time_period_end", end); +} + +//! Function to load posix_time::time_period objects using serialization lib +/*! time_period objects are broken down into 2 parts for serialization: + * a begining ptime object and an ending ptime object + */ +template<class Archive> +void load(Archive & ar, + boost::posix_time::time_period & tp, + unsigned int /*version*/) +{ + posix_time::time_duration td(1,0,0); + gregorian::date d(gregorian::not_a_date_time); + posix_time::ptime beg(d,td); + posix_time::ptime end(d,td); + ar & make_nvp("time_period_begin", beg); + ar & make_nvp("time_period_end", end); + tp = boost::posix_time::time_period(beg, end); +} + +//!override needed b/c no default constructor +template<class Archive> +inline void load_construct_data(Archive & /*ar*/, + boost::posix_time::time_period* tp, + const unsigned int /*file_version*/) +{ + posix_time::time_duration td(1,0,0); + gregorian::date d(gregorian::not_a_date_time); + posix_time::ptime beg(d,td); + posix_time::ptime end(d,td); + new(tp) boost::posix_time::time_period(beg,end); +} + +} // namespace serialization +} // namespace boost + +#endif |