33#include <boost/spirit/include/qi.hpp>
35#include "Parameters.hpp"
36#include "Exceptions.hpp"
45using namespace boost::spirit;
46using Iter = string::const_iterator;
48namespace fs = std::filesystem;
98 vector<vector<pair<schedule_step,unsigned int>>>
schedule;
102 vector<unsigned int> times;
106 size_t schedule_step_number;
110 void apply_item(
const pair<schedule_step,unsigned int>&);
145 friend ostream& operator<<(ostream&,
const Schedule&);
151 void operator()(
unsigned int, qi::unused_type, qi::unused_type)
const;
157 void operator()(
unsigned int, qi::unused_type, qi::unused_type)
const;
163 void operator()(
string, qi::unused_type, qi::unused_type)
const;
169 void operator()(qi::unused_type, qi::unused_type)
const;
175 void operator()(qi::unused_type, qi::unused_type)
const;
Wrap up the parsing process and the operation of a schedule in a single class.
Definition Schedule-16-10-23.hpp:90
void read_schedule_from_file(fs::path)
Self-explanatory.
Definition Schedule-16-10-23.cpp:143
Schedule()
You only need this constructor because everything will be filled in by the parser.
Definition Schedule-16-10-23.hpp:116
void reset_schedule()
Go back to the beginning of the schedule but leave everything else intact.
Definition Schedule-16-10-23.hpp:121
string step_to_string(size_t) const
Make a string representation of a line in the schedule.
Definition Schedule-16-10-23.cpp:236
pair< bool, unsigned int > set_next_schedule()
Apply the settings for the next step in the schedule.
Definition Schedule-16-10-23.cpp:216
Hide all the global stuff in this namespace.
Definition Schedule-16-10-23.cpp:27
schedule_step
Possible kinds of schedule step.
Definition Schedule-16-10-23.hpp:62
Semantic action for parser.
Definition Schedule-16-10-23.hpp:168
Semantic action for parser.
Definition Schedule-16-10-23.hpp:150
Semantic action for parser.
Definition Schedule-16-10-23.hpp:174
Semantic action for parser.
Definition Schedule-16-10-23.hpp:162
Semantic action for parser.
Definition Schedule-16-10-23.hpp:156