BUGFIX: Elevators did not handle Requests in the correct order
[cs356-p1-elevator.git] / elevatorcontroller.hpp
1 /*
2  * CS356 Project 01 -- Elevator Simulator
3  *
4  * ElevatorController Class Specification
5  */
6
7 #ifndef ELEVATORCONTROLLER_HPP
8 #define ELEVATORCONTROLLER_HPP
9
10 #include "direction.hpp"
11 #include "elevator.hpp"
12
13 #include <iostream>
14 #include <cstdlib>
15 #include <ctime>
16 #include <climits>
17 #include <vector>
18
19 typedef std::vector<Elevator> ElevatorList;
20
21 /* Forward-declare Exceptions */
22 class bad_elevator { };
23 class bad_floor { };
24
25 class ElevatorController
26 {
27         public:
28                 ElevatorController (int floors, int elevators);
29
30                 void call_elevator_to (int floor, Direction direction);
31                 void elevator_request (int elevator_number, int floor);
32                 void move_elevators ();
33
34                 /* true if at least one Elevator still stopping here */
35                 bool oneElevatorWillStillStopAt (int floor, Direction direction) const;
36
37         private:
38                 int number_of_floors_;
39                 int number_of_elevators_;
40
41                 ElevatorList elevators_;
42
43 };
44
45 /* vim: set ts=4 sts=4 sw=4 noet tw=112: */
46
47 #endif /* ELEVATORCONTROLLER_HPP */