EventQueue.h
Go to the documentation of this file.
1 
20 #ifndef EVENTQUEUE_H_C5C41BEE
21 #define EVENTQUEUE_H_C5C41BEE
22 
23 #include "uscxml/Common.h"
24 #include "uscxml/messages/Event.h"
25 
26 namespace uscxml {
27 
28 class EventQueueImpl;
29 class DelayedEventQueueImpl;
30 
35 class USCXML_API EventQueue {
36 public:
38 
39  virtual Event dequeue(size_t blockMs);
40  virtual void enqueue(const Event& event);
41  virtual void reset();
42 
43  Data serialize();
44  void deserialize(const Data& data);
45 
46  virtual std::shared_ptr<EventQueueImpl> getImplBase();
47 
48 protected:
49  std::shared_ptr<EventQueueImpl> _impl;
50 
51 };
52 
57 class USCXML_API DelayedEventQueue : public EventQueue {
58 public:
59  PIMPL_OPERATORS_INHERIT(DelayedEventQueue, EventQueue)
60 
61  void enqueueDelayed(const Event& event, size_t delayMs, const std::string& eventUUID);
62  void cancelDelayed(const std::string& eventUUID);
63  void cancelAllDelayed();
64  virtual std::shared_ptr<DelayedEventQueueImpl> getImplDelayed();
65 
66 protected:
67  std::shared_ptr<DelayedEventQueueImpl> _impl;
68 };
69 
70 }
71 
72 #endif /* end of include guard: EVENTQUEUE_H_C5C41BEE */
Definition: Breakpoint.cpp:26
#define PIMPL_OPERATORS(type)
The usual operators as required for the PIMPL pattern.
Definition: Common.h:68
Definition: EventQueue.h:35
Definition: EventQueue.h:57
Definition: Event.h:94
Definition: Data.h:44