Created
December 3, 2012 14:41
-
-
Save adurpas/4195417 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 EXITGATE_HPP | |
| #define EXITGATE_HPP | |
| #include <osapi/Thread.hpp> | |
| #include <osapi/Message.hpp> | |
| #include <osapi/MsgQueue.hpp> | |
| #include <osapi/Utility.hpp> | |
| #include "car.hpp" | |
| struct exitGuardOpenReq : public osapi::Message | |
| { | |
| osapi::MsgQueue* mq_; | |
| }; | |
| class exitGuard : public osapi::ThreadFunctor | |
| { | |
| public: | |
| enum | |
| { | |
| ID_EXIT_OPEN_REQ, | |
| ID_CAR_EXITED_IND | |
| }; | |
| exitGuard(unsigned long queueMaxSize); | |
| osapi::MsgQueue* getMsgQueue(); | |
| void handler(unsigned long id, osapi::Message* msg); | |
| ~exitGuard(); | |
| protected: | |
| virtual void run(); | |
| private: | |
| osapi::MsgQueue exitQueue_; | |
| }; | |
| #endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment