Interpreter.h
Go to the documentation of this file.
1 
20 #ifndef INTERPRETER_H_6CD5A168
21 #define INTERPRETER_H_6CD5A168
22 
23 
24 #include "Common.h"
25 
26 #include <map>
27 #include <string>
28 #include <vector>
29 
33 #include "uscxml/plugins/Factory.h"
37 
38 #ifdef max
39 #error define NOMINMAX or undefine the max macro please (https://support.microsoft.com/en-us/kb/143208)
40 #endif
41 
42 namespace uscxml {
43 
44 class InterpreterMonitor;
45 class InterpreterImpl;
46 class InterpreterIssue;
47 
48 
53 class USCXML_API ActionLanguage {
54 public:
62 };
63 
79 class USCXML_API Interpreter {
80 public:
81 
88  static Interpreter fromDocument(XERCESC_NS::DOMDocument* dom,
89  const std::string& baseURL,
90  bool copy = true);
97  static Interpreter fromElement(XERCESC_NS::DOMElement* element,
98  const std::string& baseURL);
104  static Interpreter fromXML(const std::string& xml,
105  const std::string& baseURL);
110  static Interpreter fromURL(const std::string& url);
111 
116  static Interpreter fromClone(const Interpreter& other);
117 
122 
136  InterpreterState step(size_t blockMs = std::numeric_limits<size_t>::max());
137 
141  void cancel();
142 
146  void reset();
147 
152  std::list<XERCESC_NS::DOMElement*> getConfiguration();
153 
159  bool isInState(const std::string& stateId);
160 
165  InterpreterState getState();
166 
171  std::list<InterpreterIssue> validate();
172 
177  void receive(const Event& event);
178 
182  void setActionLanguage(ActionLanguage actionLanguage);
183 
187  void setFactory(Factory* factory);
188 
192  void addMonitor(InterpreterMonitor* monitor);
193 
197  void removeMonitor(InterpreterMonitor* monitor);
198 
202  Logger getLogger();
203 
207  std::shared_ptr<InterpreterImpl> getImpl() const {
208  return _impl;
209  }
210 
211 protected:
212  std::shared_ptr<InterpreterImpl> _impl;
213 
214 };
215 
216 }
217 
218 #endif /* end of include guard: INTERPRETER_H_6CD5A168 */
EventQueue internalQueue
The queue where internal events will be enqueued.
Definition: Interpreter.h:59
Definition: Factory.h:46
Definition: Breakpoint.cpp:26
Definition: InterpreterMonitor.h:56
#define PIMPL_OPERATORS(type)
The usual operators as required for the PIMPL pattern.
Definition: Common.h:68
Definition: EventQueue.h:35
Central class to interpret and process SCXML documents.
Definition: Interpreter.h:79
EventQueue externalQueue
The queue for external events.
Definition: Interpreter.h:60
MicroStep microStepper
The microstepper instance to use.
Definition: Interpreter.h:56
DelayedEventQueue delayedQueue
The queue for delayed events.
Definition: Interpreter.h:61
Definition: EventQueue.h:53
Collection of instances for interpreter that constitute its action language.
Definition: Interpreter.h:53
DataModel dataModel
The datamodel to use.
Definition: Interpreter.h:57
std::shared_ptr< InterpreterImpl > getImpl() const
Return the actual implementation of the Interperter.
Definition: Interpreter.h:207
ContentExecutor execContent
To process executable content elements.
Definition: Interpreter.h:58
Definition: Event.h:84
Definition: MicroStep.h:45
Logger logger
The logger instance to use for messages.
Definition: Interpreter.h:55
The facade for data-models.
Definition: DataModel.h:40
Definition: Logging.h:69
Definition: ContentExecutor.h:42