ContentExecutorImpl.h
Go to the documentation of this file.
1 
20 #ifndef CONTENTEXECUTORIMPL_H_3ABA8969
21 #define CONTENTEXECUTORIMPL_H_3ABA8969
22 
23 
24 #include "uscxml/Common.h"
25 #include "uscxml/messages/Event.h"
28 
29 #include <string>
30 #include <set>
31 #include <map>
32 
33 namespace XERCESC_NS {
34 class DOMDocument;
35 class DOMNode;
36 }
37 
38 namespace uscxml {
39 
40 class X;
41 
46 class USCXML_API ContentExecutorCallbacks {
47 public:
48  virtual void enqueueInternal(const Event& event) = 0;
49  virtual void enqueueExternal(const Event& event) = 0;
50  virtual void enqueueExternalDelayed(const Event& event, size_t delayMs, const std::string& eventUUID) = 0;
51  virtual void cancelDelayed(const std::string& eventId) = 0;
52 
53  virtual bool isTrue(const std::string& expr) = 0;
54  virtual size_t getLength(const std::string& expr) = 0;
55 
56  virtual void setForeach(const std::string& item,
57  const std::string& array,
58  const std::string& index,
59  uint32_t iteration) = 0;
60 
61  virtual Data evalAsData(const std::string& expr) = 0;
62  virtual Data getAsData(const std::string& expr) = 0;
63  virtual void assign(const std::string& location, const Data& data, const std::map<std::string, std::string>& attrs) = 0;
64 
65 
66  virtual std::string getInvokeId() = 0;
67  virtual std::string getBaseURL() = 0;
68  virtual bool checkValidSendType(const std::string& type, const std::string& target) = 0;
69  virtual void enqueue(const std::string& type, const std::string& target, size_t delayMs, const Event& sendEvent) = 0;
70  virtual void invoke(const std::string& type, const std::string& src, bool autoForward, XERCESC_NS::DOMElement* finalize, const Event& invokeEvent) = 0;
71  virtual void uninvoke(const std::string& invokeId) = 0;
72 
73  virtual const Event& getCurrentEvent() = 0;
74 
76  virtual std::set<InterpreterMonitor*> getMonitors() = 0;
77  virtual Interpreter getInterpreter() = 0;
78  virtual Logger getLogger() = 0;
79 
80 };
81 
86 class USCXML_API ContentExecutorImpl {
87 public:
88  ContentExecutorImpl(ContentExecutorCallbacks* callbacks) : _callbacks(callbacks) {}
89 
90  virtual std::shared_ptr<ContentExecutorImpl> create(ContentExecutorCallbacks* callbacks) = 0;
91 
92  virtual void process(XERCESC_NS::DOMElement* block) = 0;
93 
94  virtual void invoke(XERCESC_NS::DOMElement* invoke) = 0;
95  virtual void uninvoke(XERCESC_NS::DOMElement* invoke) = 0;
96 
97  virtual void raiseDoneEvent(XERCESC_NS::DOMElement* state, XERCESC_NS::DOMElement* doneData) = 0;
98  virtual Data elementAsData(XERCESC_NS::DOMElement* element, bool asExpression = false) = 0;
99 
100 protected:
101  ContentExecutorCallbacks* _callbacks;
102 
103 };
104 
105 }
106 
107 #endif /* end of include guard: CONTENTEXECUTORIMPL_H_3ABA8969 */
Definition: Breakpoint.cpp:26
Central class to interpret and process SCXML documents.
Definition: Interpreter.h:79
Definition: Event.h:94
Definition: Breakpoint.h:30
Definition: ContentExecutorImpl.h:86
Definition: ContentExecutorImpl.h:46
Definition: Logging.h:69
Definition: Data.h:44