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 
65  virtual Data& getCache() = 0;
66 
67 };
68 
73 class USCXML_API MicroStepImpl {
74 public:
75  enum Binding {
76  EARLY = 0,
77  LATE = 1
78  };
79 
80  MicroStepImpl(MicroStepCallbacks* callbacks) : _callbacks(callbacks) {}
81  virtual std::shared_ptr<MicroStepImpl> create(MicroStepCallbacks* callbacks) = 0;
82 
83  virtual InterpreterState step(size_t blockMs) = 0;
84  virtual void reset() = 0;
85  virtual bool isInState(const std::string& stateId) = 0;
86  virtual std::list<XERCESC_NS::DOMElement*> getConfiguration() = 0;
87 
88  virtual void init(XERCESC_NS::DOMElement* scxml) = 0;
89  virtual void markAsCancelled() = 0;
90 
91  virtual void deserialize(const Data& encodedState) = 0;
92  virtual Data serialize() = 0;
93 
94 protected:
95  MicroStepCallbacks* _callbacks;
96 
97 };
98 
99 }
100 
101 #endif /* end of include guard: MICROSTEPIMPL_H_98233709 */
Definition: MicroStepImpl.h:73
Definition: Breakpoint.cpp:26
Definition: MicroStepImpl.h:40
Central class to interpret and process SCXML documents.
Definition: Interpreter.h:79
Definition: Event.h:94
Definition: Logging.h:69
Definition: Data.h:44