MicroStepImpl.h
Go to the documentation of this file.
1 
20 #ifndef MICROSTEPIMPL_H_98233709
21 #define MICROSTEPIMPL_H_98233709
22 
23 #include <list>
24 #include <set>
25 #include <string>
26 
27 #include "uscxml/Common.h"
28 #include "uscxml/Interpreter.h"
29 #include "uscxml/messages/Event.h"
30 
31 
32 namespace uscxml {
33 
34 class InterpreterMonitor;
35 
40 class USCXML_API MicroStepCallbacks {
41 public:
43  virtual Event dequeueInternal() = 0;
44  virtual Event dequeueExternal(size_t blockMs) = 0;
45  virtual bool isMatched(const Event& event, const std::string& eventDesc) = 0;
46  virtual void raiseDoneEvent(XERCESC_NS::DOMElement* state, XERCESC_NS::DOMElement* doneData) = 0;
47 
49  virtual bool isTrue(const std::string& expr) = 0;
50  virtual void initData(XERCESC_NS::DOMElement* element) = 0;
51 
53  virtual void process(XERCESC_NS::DOMElement* block) = 0;
54 
56  virtual void invoke(XERCESC_NS::DOMElement* invoke) = 0;
57  virtual void uninvoke(XERCESC_NS::DOMElement* invoke) = 0;
58 
60  virtual std::set<InterpreterMonitor*> getMonitors() = 0;
61  virtual Interpreter getInterpreter() = 0;
62  virtual Logger getLogger() = 0;
63 };
64 
69 class USCXML_API MicroStepImpl {
70 public:
71  enum Binding {
72  EARLY = 0,
73  LATE = 1
74  };
75 
76  MicroStepImpl(MicroStepCallbacks* callbacks) : _callbacks(callbacks) {}
77  virtual std::shared_ptr<MicroStepImpl> create(MicroStepCallbacks* callbacks) = 0;
78 
79  virtual InterpreterState step(size_t blockMs) = 0;
80  virtual void reset() = 0;
81  virtual bool isInState(const std::string& stateId) = 0;
82  virtual std::list<XERCESC_NS::DOMElement*> getConfiguration() = 0;
83 
84  virtual void init(XERCESC_NS::DOMElement* scxml) = 0;
85  virtual void markAsCancelled() = 0;
86 
87 protected:
88  MicroStepCallbacks* _callbacks;
89 
90 };
91 
92 }
93 
94 #endif /* end of include guard: MICROSTEPIMPL_H_98233709 */
Definition: MicroStepImpl.h:69
Definition: Breakpoint.cpp:26
Definition: MicroStepImpl.h:40
Central class to interpret and process SCXML documents.
Definition: Interpreter.h:79
Definition: Event.h:84
Definition: Logging.h:69