CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CommandQueue.h
Go to the documentation of this file.
1 //
3 // CommandQueue.h
4 // -------
5 //
6 // Created on: Dec 13, 2011
7 // Andrei Spataru : aspataru@cern.ch
9 
10 #ifndef COMMANDQUEUE_H_
11 #define COMMANDQUEUE_H_
12 
13 #include "boost/statechart/event_base.hpp"
14 #include <boost/shared_ptr.hpp>
15 
16 #include <queue>
17 #include <semaphore.h>
18 
19 namespace evf {
20 
21 namespace rb_statemachine {
22 
23 typedef boost::shared_ptr<boost::statechart::event_base> EventPtr;
24 
32 class CommandQueue {
33 
34 public:
35  CommandQueue();
36  ~CommandQueue();
37 
41  void enqEvent(EventPtr event);
42 
47 
48 private:
49  void lock();
50  void unlock();
51 
52 private:
53  std::queue<EventPtr> eventQueue_;
54  sem_t lock_;
55  // counting semaphore used to reflect the state of the event queue
56  sem_t commandsSem_;
57 };
58 
59 }
60 }
61 
62 #endif /* COMMANDQUEUE_H_ */
boost::shared_ptr< boost::statechart::event_base > EventPtr
Definition: CommandQueue.h:23
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
std::queue< EventPtr > eventQueue_
Definition: CommandQueue.h:53