- void read_all(int, char *, int);
- std::string read_reply(Cmd);
- void event_query_done(Error, const std::string &);
- void turnout_event_done(Error, const std::string &);
- void sensor_event_done(Error, const std::string &);
+public:
+ Control();
+ ~Control();
+
+ void open(const std::string &);
+ void set_debug(bool);
+ void set_power(bool);
+ bool get_power() const { return power; }
+ Command &command(Cmd);
+ Command &command(Cmd, unsigned char);
+ Command &command(Cmd, const unsigned char *, unsigned);
+ unsigned get_queue_length() const { return queue.size(); }
+
+ void add_turnout(Turnout &);
+ Turnout &get_turnout(unsigned) const;
+ const std::map<unsigned, Turnout *> &get_turnouts() const { return turnouts; }
+ void add_locomotive(Locomotive &);
+ Locomotive &get_locomotive(unsigned) const;
+ void add_sensor(Sensor &);
+ Sensor &get_sensor(unsigned) const;
+ const std::map<unsigned, Sensor *> &get_sensors() const { return sensors; }
+
+ void tick();
+ Msp::Time::Timer::Slot &set_timer(const Msp::Time::TimeDelta &);
+private:
+ void status_done(const Reply &);
+ void event_query_done(const Reply &);
+ void turnout_event_done(const Reply &);
+ void sensor_event_done(const Reply &);