namespace fd {
template<auto converter = schedule_timepoint_ident,
time_bounds_notation halfopen = time_bounds_notation::halfopen,
typename TP>
bool within_boundary(const TP & tp, const schedule_time_bounds & boundary);
template<auto converter, typename TP>
bool within_activity_boundary(const TP &, const schedule_timepiece &);
template<std::ranges::input_range Rng, typename Proj = std::identity>
bool all_schedules_completed(const Rng &, Proj && = {});
template<std::ranges::input_range Rng, typename Proj = std::identity>
bool any_of_fixed_duration(const Rng &, Proj && = {});
template<std::ranges::input_range Rng, typename Proj = std::identity>
bool none_of_fixed_duration(const Rng &, Proj && = {});
template<std::ranges::input_range Rng, typename Proj = std::identity>
bool execution_scheduled(const Rng &, scheduling_purpose, Proj && = {});
template<std::ranges::input_range Rng>
bool schedule_implicitly_down(const Rng &, scheduling_purpose);
template<auto converter, typename TP, std::ranges::forward_range Rng>
std::optional< bool > within_schedule_uptime(const TP &, const Rng &);
template<std::ranges::forward_range Rng>
std::optional< schedule_time_bounds >
uptime_bounds_for(const schedule_timepoint &, const Rng &);
template<std::ranges::forward_range Rng>
std::optional< std::pair< schedule_timepoint, schedule_timepoint > >
uptime_bounds_for_action(const schedule_timepiece &, const Rng &);
bool within_activity_boundary(const schedule_timepoint & now,
const schedule_timepiece & schedule);
template<std::ranges::forward_range Rng>
std::optional< bool >
within_schedule_uptime(const schedule_timepoint & now,
const Rng & schedules);
template<std::ranges::forward_range Rng>
std::optional< bool >
within_schedule_uptime(time_t now, const Rng & schedules);
template<std::ranges::forward_range Rng>
std::optional< bool >
within_schedule_uptime(std::chrono::system_clock::time_point now,
const Rng & schedules);
}
namespace fd {
enum iso_weekday_value;
iso_weekday iso_first_dow_from(special_iso_weekday);
iso_weekday_value iso_first_dow_from(iso_weekday_value);
constexpr int convert_weekday(int, int, int);
constexpr int convert_weekday(int, iso_weekday_value, iso_weekday_value);
constexpr int
offset_to_following_weekday(int fromWeekday, int toFollowingWeekday);
constexpr int offset_to_prev_weekday(int fromWeekday, int toPrevWeekday);
}
namespace fd {
struct to_iso_weekday_value;
enum iso_weekday { mon, tue, wed, thu, fri, sat, sun, first = = mon,
second = = tue, third = = wed, fourth = = thu,
fifth = = fri, sixth = = sat, seventh = = sun,
last = = sun, first_dow = = first };
enum special_iso_weekday { first_dow_from_system_locale = = -1,
first_dow_from_user_locale = = -2 };
typedef std::variant< iso_weekday, special_iso_weekday > iso_weekday_variant;
constexpr iso_weekday iso_first_dow_from(iso_weekday);
constexpr int convert_weekday(int, iso_weekday, iso_weekday);
}
namespace fd {
enum scheduling_purpose;
constexpr decltype(has_completed) & has_schedule_completed;
constexpr decltype(is_completing) & is_schedule_completing;
constexpr decltype(schedule_timepoint_to_ts) & ts_from_schedule_tp;
constexpr decltype(schedule_timepoint_to_s) & s_from_schedule_tp;
constexpr decltype(schedule_timepoint_to_tp) & tp_from_schedule_tp;
schedule_timepoint schedule_timepoint_ident(schedule_timepoint);
constexpr bool operator!(const schedule_timepoint & tp);
template<time_bounds_notation halfopen = time_bounds_notation::halfopen,
typename TP>
bool within_timepoint_interval(const TP & tp,
const time_bounds< TP > & interval);
bool has_completed(const schedule_timepiece & schedule);
bool is_completing(const schedule_timepiece &);
bool will_complete_after_current_interval(const schedule_timepiece &);
bool is_action_schedule(const schedule_timepiece & schedule);
bool is_application_action_schedule(const schedule_timepiece & schedule,
scheduling_purpose purpose);
bool is_task_execution_schedule(const schedule_timepiece & schedule,
scheduling_purpose purpose);
bool is_fixed_duration_schedule(const schedule_timepiece & schedule);
bool is_uptime_schedule(const schedule_timepiece & schedule);
bool is_downtime_schedule(const schedule_timepiece & schedule);
bool is_completed_downtime_schedule(const schedule_timepiece & schedule);
bool is_ongoing_action_schedule(const schedule_timepiece & schedule);
bool is_completing_application_action_schedule(const schedule_timepiece & schedule,
scheduling_purpose purpose);
bool is_completed_application_action_schedule(const schedule_timepiece & schedule,
scheduling_purpose purpose);
bool is_completed_task_execution_schedule(const schedule_timepiece & schedule,
scheduling_purpose purpose);
bool is_ongoing_fixed_duration_schedule(const schedule_timepiece & schedule);
bool is_non_operational_interval(const schedule_time_bounds &);
bool is_non_operational_interval(const schedule_timepiece &);
bool is_contiguously_up(const schedule_timepiece &);
bool is_contiguously_down(const schedule_timepiece &);
schedule_timepoint ts_to_schedule_timepoint(time_t ts);
time_t schedule_timepoint_to_ts(const schedule_timepoint & tp);
schedule_timepoint s_to_schedule_timepoint(std::chrono::seconds s);
std::chrono::seconds schedule_timepoint_to_s(const schedule_timepoint & tp);
schedule_timepoint
tp_to_schedule_timepoint(std::chrono::system_clock::time_point tp);
std::chrono::system_clock::time_point
schedule_timepoint_to_tp(const schedule_timepoint & tp);
template<typename R = schedule_timepoint>
R currently_scheduled_at(const schedule_timepiece & schedule);
template<auto converter>
decltype(auto) currently_scheduled_at(const schedule_timepiece & schedule);
template<typename R = schedule_timepoint>
R currently_ending_at(const schedule_timepiece & schedule);
template<auto converter>
decltype(auto) currently_ending_at(const schedule_timepiece & schedule);
time_t currently_scheduled_at__ts(const schedule_timepiece & schedule);
time_t currently_ending_at__ts(const schedule_timepiece & schedule);
std::chrono::seconds
currently_scheduled_at__s(const schedule_timepiece & schedule);
std::chrono::seconds
currently_ending_at__s(const schedule_timepiece & schedule);
std::chrono::system_clock::time_point
currently_scheduled_at__tp(const schedule_timepiece & schedule);
std::chrono::system_clock::time_point
currently_ending_at__tp(const schedule_timepiece & schedule);
template<typename R = schedule_timepoint>
time_bounds< R > convert(const schedule_time_bounds & span);
template<auto converter> auto convert(const schedule_time_bounds & span);
template<typename R = schedule_timepoint>
time_bounds< R > current_interval(const schedule_timepiece & schedule);
template<auto converter>
decltype(auto) current_interval(const schedule_timepiece & schedule);
time_bounds< time_t >
current_interval__ts(const schedule_timepiece & schedule);
time_bounds< std::chrono::seconds >
current_interval__s(const schedule_timepiece & schedule);
time_bounds< std::chrono::system_clock::time_point >
current_interval__tp(const schedule_timepiece & schedule);
timepiece_move
natural_timepiece_move_setup(const interval_schedule_data &,
scheduling_purpose);
std::tuple< schedule_timepiece &, timepiece_move, schedule_timepoint >
natural_timepiece_move_arguments(schedule_timepiece &, scheduling_purpose,
const schedule_timepoint & = schedule_clock::local_time());
template<typename R = schedule_timepoint>
R advance(schedule_timepiece & schedule, timepiece_move advanceTo,
const schedule_timepoint & now = schedule_clock::local_time());
template<auto converter>
decltype(auto)
advance(schedule_timepiece & schedule, timepiece_move advanceTo,
const schedule_timepoint & now = schedule_clock::local_time());
time_t advance__ts(schedule_timepiece & schedule, timepiece_move advanceTo,
const schedule_timepoint & now = schedule_clock::local_time());
std::chrono::seconds
advance__s(schedule_timepiece & schedule, timepiece_move advanceTo,
const schedule_timepoint & now = schedule_clock::local_time());
std::chrono::system_clock::time_point
advance__tp(schedule_timepiece & schedule, timepiece_move advanceTo,
const schedule_timepoint & now = schedule_clock::local_time());
}
namespace fd {
struct interval_onset;
struct interval_onset_duration;
struct interval_spec;
enum interval_granularity { invalid_interval_granularity = = 0,
second_interval = = 0x01,
minute_interval = = 0x02,
hour_interval = = 0x04, day_interval = = 0x08,
week_interval = = 0x10, month_interval = = 0x20,
year_interval = = 0x40,
first_interval_granularity = = second_interval,
last_interval_granularity = = year_interval };
enum special_interval_factor { numeric_interval_factor = = 0,
leapyear_interval_factor = = -1 };
typedef int32_t time_value_t;
typedef unsigned short greg_value_t;
constexpr auto time_intervals;
constexpr auto date_intervals;
constexpr auto day_intervals;
constexpr int convert_weekday(const interval_onset &, iso_weekday_value);
bool operator==(const interval_onset & o2, const interval_onset & o1);
}
namespace fd {
template<typename date_type> class leapyear_filter_functor;
class leapyear_iterator;
struct ptime_iteration_state;
bool less_schedule_timepoint(const schedule_timepoint & left,
const schedule_timepoint & right);
bool less_equal_schedule_timepoint(const schedule_timepoint & left,
const schedule_timepoint & right);
}
namespace fd {
enum ptree_io_storage { xml, json };
static std::wstring_convert< std::codecvt_utf8_utf16< wchar_t > > u2u8conv;
std::list< interval_schedule_definition >
read_interval_schedule(const boost::property_tree::ptree & rootTree,
ptree_io_storage storageType,
const std::function< void(const boost::property_tree::ptree &, interval_schedule_data *)> & read_appdata = {});
void write_interval_schedule(boost::property_tree::ptree & rootTree,
const std::list< interval_schedule_definition > & schedules,
ptree_io_storage storageType,
const std::function< void(boost::property_tree::ptree &, const interval_schedule_data &)> & write_appdata = {},
std::initializer_list< std::pair< boost::property_tree::ptree::key_type, boost::property_tree::ptree::data_type > > ns = {});
}
namespace fd {
class schedule_timepiece;
struct timepiece_settings;
enum timepiece_move { rewind, to_adjacent_end, to_current, to_adjacent,
to_adjacent_begin = = to_adjacent, to_next };
}
namespace fd {
enum time_bounds_notation;
typedef boost::posix_time::ptime schedule_timepoint;
typedef std::pair< TP, TP > time_bounds;
typedef time_bounds<> schedule_time_bounds;
typedef boost::date_time::time_itr< schedule_timepoint > schedule_time_iterator;
typedef boost::date_time::second_clock< schedule_timepoint > schedule_clock;
typedef schedule_timepoint::time_system_type schedule_time_system;
typedef schedule_time_system::time_duration_type::traits_type schedule_time_traits;
typedef std::chrono::duration< schedule_time_traits::tick_type, std::ratio< 1, schedule_time_traits::ticks_per_second > > schedule_duration;
}
namespace fd {
class timepiece_test_player;
enum zeitgeber_timepoint_type { onset, ending, prelude = = ending };
}