Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Road.h
00001 #ifndef _ROAD_H_ 00002 #define _ROAD_H_ 00003 00004 #include "mbed.h" 00005 #include "AccCar.h" 00006 #include "Intersection.h" 00007 00008 #define MAX_CARS 5 00009 00010 class AccCar; 00011 00012 class Road { 00013 public: 00014 EventFlags go_flags; 00015 EventFlags done_flags; 00016 int active_cars; 00017 00018 Road(Intersection* intersection, int roadId); 00019 Intersection* intersection; 00020 int try_enter_car(int time); 00021 void let_cars_update(); 00022 void wait_for_car_update(); 00023 void check_exit_cars(); 00024 void intendToEnter(int id); 00025 int roadId; 00026 00027 void print_status(); 00028 00029 00030 private: 00031 AccCar* last_car; 00032 AccCar* cars[MAX_CARS]; 00033 00034 AccCar* pending_car; 00035 int next_release; 00036 int num_cars; 00037 }; 00038 #endif
Generated on Wed Jul 20 2022 19:41:08 by
1.7.2