Created
December 3, 2012 14:42
-
-
Save adurpas/4195427 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ISU laboratory session #8, exercise #3. | |
| #ifndef CAR_HPP | |
| #define CAR_HPP | |
| #include <osapi/Thread.hpp> | |
| #include <osapi/Message.hpp> | |
| #include <osapi/MsgQueue.hpp> | |
| #include <osapi/Utility.hpp> | |
| #include "EntryGuard.hpp" | |
| #include "ExitGuard.hpp" | |
| class car : public osapi::ThreadFunctor | |
| { | |
| public: | |
| enum | |
| { | |
| ID_CAR_START_IND, | |
| ID_ENTRY_OPEN_CFM, | |
| ID_EXIT_OPEN_CFM, | |
| }; | |
| car(int carThreadID, unsigned long queueMaxSize, entryGuard* entryGuard, exitGuard* exitGuard); | |
| osapi::MsgQueue* getMsgQueue(); | |
| void handler(unsigned long id, osapi::Message* msg); | |
| ~car(); | |
| protected: | |
| virtual void run(); | |
| private: | |
| int carID_; | |
| osapi::MsgQueue carQueue_; | |
| entryGuard* entryGuard_; | |
| exitGuard* exitGuard_; | |
| }; | |
| #endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment