InvokerImpl.h
Go to the documentation of this file.
1 
20 #ifndef INVOKERIMPL_H_8A15A102
21 #define INVOKERIMPL_H_8A15A102
22 
23 
24 #include "uscxml/config.h"
25 #include "uscxml/Common.h"
27 #include "uscxml/messages/Event.h"
28 
29 #include <set>
30 
31 namespace uscxml {
32 
33 class Interpreter;
34 class InterpreterMonitor;
35 class ActionLanguage;
36 class Logger;
37 
43 class USCXML_API InvokerCallbacks {
44 public:
45  virtual ~InvokerCallbacks() {}
46  virtual void enqueueInternal(const Event& event) = 0;
47  virtual void enqueueExternal(const Event& event) = 0;
48  virtual ActionLanguage* getActionLanguage() = 0;
49  virtual std::set<InterpreterMonitor*> getMonitors() = 0;
50  virtual std::string getBaseURL() = 0;
51  virtual Logger getLogger() = 0;
52 };
53 
59 class USCXML_API InvokerImpl : public EventHandlerImpl {
60 public:
61  InvokerImpl() {};
62  virtual ~InvokerImpl() {}
63 
64  virtual std::list<std::string> getNames() = 0;
65 
70  virtual std::shared_ptr<InvokerImpl> create(InvokerCallbacks* callbacks) = 0;
71 
77  virtual void invoke(const std::string& source, const Event& invokeEvent) = 0;
78 
82  virtual void uninvoke() = 0;
83 
87  virtual void eventFromSCXML(const Event& event) = 0;
88 
93  virtual void setInvokeId(const std::string& invokeId) {
94  _invokeId = invokeId;
95  }
96 
101  virtual void deserialize(const Data& encodedState) {}
102 
106  virtual Data serialize() {
107  return Data();
108  }
109 
110 protected:
118  void eventToSCXML(Event& event, const std::string& type, const std::string& invokeId, bool internal = false);
119 
120  std::string _invokeId;
121  InvokerCallbacks* _callbacks;
122 };
123 
124 }
125 
126 
127 #endif /* end of include guard: INVOKERIMPL_H_8A15A102 */
Definition: Breakpoint.cpp:26
virtual void setInvokeId(const std::string &invokeId)
Set the invocation identifier as required when returning events.
Definition: InvokerImpl.h:93
Abstract base class for all invokers.
Definition: InvokerImpl.h:59
Collection of instances for interpreter that constitute its action language.
Definition: Interpreter.h:53
Common base class for invokers and i/o processors.
Definition: EventHandler.h:41
virtual void deserialize(const Data &encodedState)
Load a state from a Data object.
Definition: InvokerImpl.h:101
Definition: Event.h:94
virtual ~InvokerCallbacks()
silence virtual destructor warning from swig
Definition: InvokerImpl.h:45
Callbacks available for every invoker.
Definition: InvokerImpl.h:43
Definition: Logging.h:69
virtual Data serialize()
Save our state into a Data object.
Definition: InvokerImpl.h:106
Definition: Data.h:44