1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
|
/**
* @file
* @author 2016 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de)
* @copyright Simplified BSD
*
* @cond
* This program is free software: you can redistribute it and/or modify
* it under the terms of the FreeBSD license as published by the FreeBSD
* project.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* You should have received a copy of the FreeBSD license along with this
* program. If not, see <http://www.opensource.org/licenses/bsd-license>.
* @endcond
*/
#ifndef CONTENTEXECUTORIMPL_H_3ABA8969
#define CONTENTEXECUTORIMPL_H_3ABA8969
#include "uscxml/Common.h"
#include "uscxml/util/DOM.h"
#include "uscxml/messages/Event.h"
#include "uscxml/interpreter/InterpreterMonitor.h"
#include <xercesc/dom/DOM.hpp>
#include <string>
namespace uscxml {
/**
* @ingroup execcontent
* @ingroup callback
*/
class USCXML_API ContentExecutorCallbacks {
public:
virtual void enqueueInternal(const Event& event) = 0;
virtual void enqueueExternal(const Event& event) = 0;
virtual void enqueueExternalDelayed(const Event& event, size_t delayMs, const std::string& eventUUID) = 0;
virtual void cancelDelayed(const std::string& eventId) = 0;
virtual bool isTrue(const std::string& expr) = 0;
virtual size_t getLength(const std::string& expr) = 0;
virtual void setForeach(const std::string& item,
const std::string& array,
const std::string& index,
uint32_t iteration) = 0;
virtual Data evalAsData(const std::string& expr) = 0;
virtual Data getAsData(const std::string& expr) = 0;
virtual void assign(const std::string& location, const Data& data) = 0;
virtual std::string getInvokeId() = 0;
virtual std::string getBaseURL() = 0;
virtual bool checkValidSendType(const std::string& type, const std::string& target) = 0;
virtual void enqueue(const std::string& type, const std::string& target, size_t delayMs, const Event& sendEvent) = 0;
virtual void invoke(const std::string& type, const std::string& src, bool autoForward, XERCESC_NS::DOMElement* finalize, const Event& invokeEvent) = 0;
virtual void uninvoke(const std::string& invokeId) = 0;
virtual const Event& getCurrentEvent() = 0;
/** Monitoring */
virtual std::set<InterpreterMonitor*> getMonitors() = 0;
virtual InterpreterImpl* getInterpreter() = 0;
};
/**
* @ingroup execcontent
* @ingroup impl
*/
class USCXML_API ContentExecutorImpl {
public:
ContentExecutorImpl(ContentExecutorCallbacks* callbacks) : _callbacks(callbacks) {}
virtual void process(XERCESC_NS::DOMElement* block, const X& xmlPrefix) = 0;
virtual void invoke(XERCESC_NS::DOMElement* invoke) = 0;
virtual void uninvoke(XERCESC_NS::DOMElement* invoke) = 0;
virtual void raiseDoneEvent(XERCESC_NS::DOMElement* state, XERCESC_NS::DOMElement* doneData) = 0;
virtual Data elementAsData(XERCESC_NS::DOMElement* element) = 0;
protected:
ContentExecutorCallbacks* _callbacks;
};
}
#endif /* end of include guard: CONTENTEXECUTORIMPL_H_3ABA8969 */
|