EventQueueImpl.h
Go to the documentation of this file.
1 
20 #ifndef EVENTQUEUEIMPL_H_48027643
21 #define EVENTQUEUEIMPL_H_48027643
22 
23 #include "uscxml/Common.h"
24 #include "uscxml/messages/Event.h"
25 #include <string>
26 #include <map>
27 #include <list>
28 #include <thread>
29 #include <mutex>
30 #include <condition_variable>
31 
32 
33 namespace uscxml {
34 
39 class USCXML_API EventQueueImpl {
40 public:
41  virtual std::shared_ptr<EventQueueImpl> create() = 0;
42  virtual Event dequeue(size_t blockMs) = 0;
43  virtual void enqueue(const Event& event) = 0;
44  virtual void reset() = 0;
45  virtual Data serialize() = 0;
46  virtual void deserialize(const Data& data) = 0;
47 };
48 
53 class USCXML_API DelayedEventQueueCallbacks {
54 public:
55  virtual void eventReady(Event& event, const std::string& eventId) = 0;
56 };
57 
62 class USCXML_API DelayedEventQueueImpl : public EventQueueImpl {
63 public:
64  virtual std::shared_ptr<DelayedEventQueueImpl> create(DelayedEventQueueCallbacks*) = 0;
65  virtual void enqueueDelayed(const Event& event, size_t delayMs, const std::string& eventUUID) = 0;
66  virtual void cancelDelayed(const std::string& eventId) = 0;
67  virtual void cancelAllDelayed() = 0;
68 
69  virtual Data serialize() = 0;
70  virtual void deserialize(const Data& data) = 0;
71 
72 private:
73  // this will silence the warning about the hidden overloaded virtual function
74  using EventQueueImpl::create;
75 };
76 
77 }
78 
79 #endif /* end of include guard: EVENTQUEUEIMPL_H_48027643 */
Definition: Breakpoint.cpp:26
Definition: EventQueueImpl.h:53
Definition: Event.h:94
Definition: EventQueueImpl.h:62
Definition: EventQueueImpl.h:39
Definition: Data.h:44