summaryrefslogtreecommitdiffstats
path: root/src/uscxml/messages/Event.h
diff options
context:
space:
mode:
authorStefan Radomski <radomski@tk.informatik.tu-darmstadt.de>2014-07-01 22:51:30 (GMT)
committerStefan Radomski <radomski@tk.informatik.tu-darmstadt.de>2014-07-01 22:51:30 (GMT)
commit945160d0539ad119ffc986fac712db76c7203e84 (patch)
treec43e4a7db898026bc62cc20af5061d07736f847e /src/uscxml/messages/Event.h
parentc70d02010ea99e6c8e35da3b767f41f1ee5dce56 (diff)
downloaduscxml-945160d0539ad119ffc986fac712db76c7203e84.zip
uscxml-945160d0539ad119ffc986fac712db76c7203e84.tar.gz
uscxml-945160d0539ad119ffc986fac712db76c7203e84.tar.bz2
More polishing for bindings C# and Java
Diffstat (limited to 'src/uscxml/messages/Event.h')
-rw-r--r--src/uscxml/messages/Event.h57
1 files changed, 57 insertions, 0 deletions
diff --git a/src/uscxml/messages/Event.h b/src/uscxml/messages/Event.h
index 1acfce7..6697bb9 100644
--- a/src/uscxml/messages/Event.h
+++ b/src/uscxml/messages/Event.h
@@ -22,6 +22,56 @@
#include "uscxml/messages/Data.h"
+#define ERROR_EXECUTION(identifier, cause) \
+ uscxml::Event identifier; \
+ identifier.data.compound["cause"] = uscxml::Data(cause, uscxml::Data::VERBATIM); \
+ identifier.name = "error.execution"; \
+ identifier.eventType = uscxml::Event::PLATFORM;
+
+#define ERROR_EXECUTION2(identifier, cause, node) \
+ uscxml::Event identifier; \
+ identifier.data.compound["cause"] = uscxml::Data(cause, uscxml::Data::VERBATIM); \
+ identifier.name = "error.execution"; \
+ identifier.data.compound["xpath"] = uscxml::Data(DOMUtils::xPathForNode(node), uscxml::Data::VERBATIM); \
+ identifier.eventType = uscxml::Event::PLATFORM;
+
+#define ERROR_COMMUNICATION(identifier, cause) \
+ uscxml::Event identifier; \
+ identifier.data.compound["cause"] = uscxml::Data(cause, uscxml::Data::VERBATIM); \
+ identifier.name = "error.communication"; \
+ identifier.eventType = uscxml::Event::PLATFORM;
+
+#define ERROR_COMMUNICATION2(identifier, cause, node) \
+ uscxml::Event identifier; \
+ identifier.data.compound["cause"] = uscxml::Data(cause, uscxml::Data::VERBATIM); \
+ identifier.name = "error.communication"; \
+ identifier.data.compound["xpath"] = uscxml::Data(DOMUtils::xPathForNode(node), uscxml::Data::VERBATIM); \
+ identifier.eventType = uscxml::Event::PLATFORM;
+
+#define ERROR_EXECUTION_THROW(cause) \
+{\
+ ERROR_EXECUTION(exc, cause); \
+ throw exc;\
+}
+
+#define ERROR_EXECUTION_THROW2(cause, node) \
+{\
+ ERROR_EXECUTION2(exc, cause, node); \
+ throw exc;\
+}
+
+#define ERROR_COMMUNICATION_THROW(cause) \
+{\
+ ERROR_COMMUNICATION(exc, cause); \
+ throw exc;\
+}
+
+#define ERROR_COMMUNICATION_THROW2(cause, node) \
+{\
+ ERROR_COMMUNICATION(exc, cause, node); \
+ throw exc;\
+}
+
namespace uscxml {
class USCXML_API Event {
@@ -145,6 +195,13 @@ public:
return params;
}
+ void setNameList(const std::map<std::string, Data>& nameList) {
+ this->namelist = nameList;
+ }
+ void setParams(const std::multimap<std::string, Data>& params) {
+ this->params = params;
+ }
+
typedef std::multimap<std::string, Data> params_t;
typedef std::map<std::string, Data> namelist_t;