namespace fd {
template<typename TP>
bool within_interval(const TP & now, const std::pair< TP, TP > & interval);
template<typename TP>
bool within_boundary(const TP &, const std::pair< TP, TP > &);
template<auto conv, typename TP>
bool within_activity_boundary(const TP & now,
const schedule_timepiece & s);
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 conv, 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< std::pair< schedule_timepoint, schedule_timepoint > >
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_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);
iso_weekday iso_first_dow_from(special_iso_weekday);
constexpr int convert_weekday(int, iso_weekday, iso_weekday);
}
namespace fd {
enum scheduling_purpose;
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;
static constexpr decltype(schedule_timepoint_to_ts) & ts_from_schedule_tp;
static constexpr decltype(schedule_timepoint_to_s) & s_from_schedule_tp;
static constexpr decltype(schedule_timepoint_to_tp) & tp_from_schedule_tp;
bool has_completed(const schedule_timepiece & schedule);
bool has_schedule_completed(const schedule_timepiece & schedule);
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_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 std::pair< schedule_timepoint, schedule_timepoint > &);
bool is_non_operational_interval(const schedule_timepiece &);
schedule_timepoint schedule_timepoint_ident(schedule_timepoint tp);
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 conv>
decltype(auto) currently_scheduled_at(const schedule_timepiece & schedule);
template<typename R = schedule_timepoint>
R currently_ending_at(const schedule_timepiece & schedule);
template<auto conv>
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>
std::pair< R, R >
convert(const std::pair< schedule_timepoint, schedule_timepoint > & span);
template<auto conv>
decltype(auto)
convert(const std::pair< schedule_timepoint, schedule_timepoint > & span);
template<typename R = schedule_timepoint>
std::pair< R, R > current_interval(const schedule_timepiece & schedule);
template<auto conv>
decltype(auto) current_interval(const schedule_timepiece & schedule);
std::pair< time_t, time_t >
current_interval__ts(const schedule_timepiece & schedule);
std::pair< std::chrono::seconds, std::chrono::seconds >
current_interval__s(const schedule_timepiece & schedule);
std::pair< std::chrono::system_clock::time_point, std::chrono::system_clock::time_point >
current_interval__tp(const schedule_timepiece & schedule);
template<typename R = schedule_timepoint>
R advance(schedule_timepiece & schedule, timepiece_move advanceTo,
const schedule_timepoint & now = schedule_clock::local_time());
template<auto conv>
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_spec;
struct interval_onset;
struct interval_onset_duration;
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;
typedef boost::posix_time::ptime schedule_timepoint;
typedef schedule_timepoint::time_system_type schedule_time_system;
typedef boost::date_time::second_clock< schedule_timepoint > schedule_clock;
typedef boost::date_time::time_itr< schedule_timepoint > schedule_time_iterator;
typedef std::pair< DateIterator, const boost::posix_time::time_duration > date_iteration_state;
typedef std::tuple< DateIterator, const boost::posix_time::time_duration, const boost::gregorian::nth_kday_of_month::week_num, const greg_value_t > kdate_iteration_state;
typedef schedule_time_iterator time_iteration_state;
typedef date_iteration_state< boost::gregorian::day_iterator > day_iteration_state;
typedef date_iteration_state< boost::gregorian::week_iterator > week_iteration_state;
typedef date_iteration_state< boost::gregorian::month_iterator > month_iteration_state;
typedef kdate_iteration_state< boost::gregorian::month_iterator > kday_of_month_iteration_state;
typedef date_iteration_state< boost::gregorian::year_iterator > year_iteration_state;
typedef kdate_iteration_state< boost::gregorian::year_iterator > kday_of_year_iteration_state;
typedef date_iteration_state< leapyear_iterator > leapyear_iteration_state;
typedef kdate_iteration_state< leapyear_iterator > kday_of_leapyear_iteration_state;
typedef std::variant< time_iteration_state, day_iteration_state, week_iteration_state, month_iteration_state, kday_of_month_iteration_state, year_iteration_state, leapyear_iteration_state, kday_of_year_iteration_state, kday_of_leapyear_iteration_state > onset_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::vector< 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::vector< 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 {
struct timepiece_settings;
class schedule_timepiece;
enum timepiece_move { rewind, to_adjacent_end, to_current, to_adjacent,
to_adjacent_begin = = to_adjacent, to_next };
}