const time_t WeekCron::StNimmerleinsDay = static_cast<time_t>(-1);
/**
+ * Constructor, leaves object in invalid state
+ */
+WeekCron::WeekCron()
+ : Begin(-1)
+ , End(0)
+ , Every(-1)
+ , Week()
+{
+}
+
+/**
* Constructor
* @param daystring String representing the active weekdays as numbers. 0 is Sunday.
* @param begin Start point of time in seconds since the start of the day
{
}
+/**
+ * Constructor
+ * @param week I2n::Time::Week object representing the active days
+ * @param begin Start point of time in seconds since the start of the day
+ */
+WeekCron::WeekCron(const I2n::Time::Week& week, const int begin)
+ : Begin(begin)
+ , End(0)
+ , Every(-1)
+ , Week(week)
+{
+}
+
+/**
+ * Constructor
+ * @param week I2n::Time::Week object representing the active days
+ * @param begin Start point of time in seconds since the start of the day
+ * @param end End point of time in seconds since the start of the day. Only used when every != -1
+ * @param every Repeat event every xxx seconds in the half-open interval of begin and end. -1 is disabled
+ */
+WeekCron::WeekCron(const I2n::Time::Week& week, const int begin, const int end, const int every)
+ : Begin(begin)
+ , End(end)
+ , Every(every)
+ , Week(week)
+{
+}
/**
* Checks if the input values are sane
time_t get_previousnow_point(const time_t calc_from, const int daysec, const bool todaycheck) const;
public:
+ WeekCron();
WeekCron(const std::string& daystring, const int begin);
WeekCron(const std::string& daystring, const int begin, const int end, const int every);
+ WeekCron(const I2n::Time::Week& week, const int begin);
+ WeekCron(const I2n::Time::Week& week, const int begin, const int end, const int every);
+
+ // accessor functions
+ I2n::Time::Week get_week(void)
+ { return Week; }
+ void set_week(const I2n::Time::Week& week)
+ { Week=week; }
+ int get_begin(void)
+ { return Begin; }
+ void set_begin(const int begin)
+ { Begin=begin; }
+ int get_end(void)
+ { return End; }
+ void set_end(const int end)
+ { End=end; }
+ int get_every(void)
+ { return Every; }
+ void set_every(const int every)
+ { Every=every; }
bool is_sane() const;