1 /* 2 BAREOS® - Backup Archiving REcovery Open Sourced 3 4 Copyright (C) 2000-2011 Free Software Foundation Europe e.V. 5 Copyright (C) 2011-2012 Planets Communications B.V. 6 Copyright (C) 2013-2019 Bareos GmbH & Co. KG 7 8 This program is Free Software; you can redistribute it and/or 9 modify it under the terms of version three of the GNU Affero General Public 10 License as published by the Free Software Foundation and included 11 in the file LICENSE. 12 13 This program is distributed in the hope that it will be useful, but 14 WITHOUT ANY WARRANTY; without even the implied warranty of 15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 Affero General Public License for more details. 17 18 You should have received a copy of the GNU Affero General Public License 19 along with this program; if not, write to the Free Software 20 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 21 02110-1301, USA. 22 */ 23 24 #ifndef BAREOS_SRC_DIRD_RUN_HOUR_VALIDATOR_H_ 25 #define BAREOS_SRC_DIRD_RUN_HOUR_VALIDATOR_H_ 26 27 namespace directordaemon { 28 29 struct DateTimeBitfield; 30 31 class RunHourValidator { 32 public: 33 RunHourValidator(time_t time); 34 void PrintDebugMessage(int debuglevel) const; 35 bool TriggersOn(const DateTimeBitfield& date_time_bitfield); Time()36 time_t Time() const { return time_; } 37 38 private: 39 int hour_{0}; 40 int mday_{0}; 41 int wday_{0}; 42 int month_{0}; 43 int wom_{0}; 44 int woy_{0}; 45 int yday_{0}; 46 time_t time_{0}; 47 bool is_last_week_{false}; 48 }; 49 50 } // namespace directordaemon 51 52 #endif // BAREOS_SRC_DIRD_RUN_HOUR_VALIDATOR_H_ 53