summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorStefan Radomski <radomski@tk.informatik.tu-darmstadt.de>2013-08-13 12:24:51 (GMT)
committerStefan Radomski <radomski@tk.informatik.tu-darmstadt.de>2013-08-13 12:24:51 (GMT)
commitd35b69b97dead2e50dda697f0fb0d5e574bbf205 (patch)
tree6eac5b09bdc23b3aeb478779a7a25f5caf0f3568 /src
parent459f406eb2a36d393bd3a2b6aa3d63d86eb99c07 (diff)
downloaduscxml-d35b69b97dead2e50dda697f0fb0d5e574bbf205.zip
uscxml-d35b69b97dead2e50dda697f0fb0d5e574bbf205.tar.gz
uscxml-d35b69b97dead2e50dda697f0fb0d5e574bbf205.tar.bz2
Renamed event.type to eventType to avoid clash with send.type and invoker.type
Diffstat (limited to 'src')
-rw-r--r--src/bindings/swig/java/JavaDataModel.h61
-rw-r--r--src/bindings/swig/java/uscxml.i11
-rw-r--r--src/uscxml/Factory.cpp8
-rw-r--r--src/uscxml/Interpreter.cpp6
-rw-r--r--src/uscxml/Message.cpp2
-rw-r--r--src/uscxml/Message.h65
-rw-r--r--src/uscxml/interpreter/InterpreterDraft6.cpp2
-rw-r--r--src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDataModel.cpp2
-rw-r--r--src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCSCXMLEvent.cpp2
-rw-r--r--src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCSCXMLEvent.h2
-rw-r--r--src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCSCXMLEventCustom.cpp4
-rw-r--r--src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCXPathResultCustom.cpp18
-rw-r--r--src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.cpp2
-rw-r--r--src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8SCXMLEvent.h4
-rw-r--r--src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8SCXMLEventCustom.cpp4
-rw-r--r--src/uscxml/plugins/datamodel/prolog/swi/SWIDataModel.cpp2
-rw-r--r--src/uscxml/plugins/datamodel/xpath/XPathDataModel.cpp2
-rw-r--r--src/uscxml/plugins/invoker/umundo/UmundoInvoker.cpp8
-rw-r--r--src/uscxml/plugins/ioprocessor/basichttp/BasicHTTPIOProcessor.cpp2
-rw-r--r--src/uscxml/plugins/ioprocessor/modality/MMIHTTPIOProcessor.cpp2
20 files changed, 108 insertions, 101 deletions
diff --git a/src/bindings/swig/java/JavaDataModel.h b/src/bindings/swig/java/JavaDataModel.h
index 9188cf6..5d76480 100644
--- a/src/bindings/swig/java/JavaDataModel.h
+++ b/src/bindings/swig/java/JavaDataModel.h
@@ -44,7 +44,11 @@ public:
virtual void popContext() {}
virtual void eval(const Arabica::DOM::Element<std::string>& scriptElem,
- const std::string& expr) {}
+ const std::string& expr) {
+ std::ostringstream ssEval;
+ ssEval << scriptElem;
+ eval(ssEval.str(), expr);
+ }
virtual std::string evalAsString(const std::string& expr) {
return "";
@@ -59,14 +63,61 @@ public:
virtual void assign(const Arabica::DOM::Element<std::string>& assignElem,
const Arabica::DOM::Document<std::string>& doc,
- const std::string& content) {}
- virtual void assign(const std::string& location, const Data& data) {}
+ const std::string& content) {
+ // convert XML back into strings
+ std::string location;
+ if (assignElem.hasAttribute("location")) {
+ location = assignElem.getAttribute("location");
+ }
+ std::ostringstream ssAssign;
+ ssAssign << assignElem;
+ std::string tmp;
+ if (doc) {
+ std::ostringstream ssContent;
+ ssContent << doc;
+ tmp = ssContent.str();
+ } else {
+ tmp = content;
+ }
+ assign(location, ssAssign.str(), tmp);
+ }
+
+ virtual void assign(const std::string& location, const Data& data) {
+ init("", location, Data::toJSON(data));
+ }
+
+ // this is assign the function exposed to java
virtual void init(const Arabica::DOM::Element<std::string>& dataElem,
const Arabica::DOM::Document<std::string>& doc,
- const std::string& content) {}
- virtual void init(const std::string& location, const Data& data) {}
+ const std::string& content) {
+ // convert XML back into strings
+ std::string location;
+ if (dataElem.hasAttribute("id")) {
+ location = dataElem.getAttribute("id");
+ }
+ std::ostringstream ssData;
+ if (dataElem)
+ ssData << dataElem;
+ std::string tmp;
+ if (doc) {
+ std::ostringstream ssContent;
+ ssContent << doc;
+ tmp = ssContent.str();
+ } else {
+ tmp = content;
+ }
+ init(location, ssData.str(), tmp);
+ }
+
+ virtual void init(const std::string& location, const Data& data) {
+ init("", location, Data::toJSON(data));
+ }
+ // these functions are exposed to java
+ virtual void init(const std::string& dataElem, const std::string& location, const std::string& content) {}
+ virtual void assign(const std::string& assignElem, const std::string& location, const std::string& content) {}
+ virtual void eval(const std::string& scriptElem, const std::string& expr) {}
};
diff --git a/src/bindings/swig/java/uscxml.i b/src/bindings/swig/java/uscxml.i
index 81ac83e..02ef531 100644
--- a/src/bindings/swig/java/uscxml.i
+++ b/src/bindings/swig/java/uscxml.i
@@ -1,5 +1,8 @@
%module(directors="1", allprotected="1") uscxmlNativeJava
+// provide a macro for the header files
+#define SWIGIMPORTED 1
+
// import swig typemaps
//%include <arrays_java.i>
//%include <inttypes.i>
@@ -12,7 +15,6 @@
%include <boost_shared_ptr.i>
-
typedef uscxml::Data Data;
typedef uscxml::Event Event;
typedef uscxml::InvokeRequest InvokeRequest;
@@ -68,6 +70,12 @@ using namespace uscxml;
%ignore uscxml::JavaInvoker::create(InterpreterImpl*);
%ignore uscxml::JavaDataModel::create(InterpreterImpl*);
+%ignore uscxml::JavaDataModel::init(const Arabica::DOM::Element<std::string>&, const Arabica::DOM::Document<std::string>&, const std::string&);
+%ignore uscxml::JavaDataModel::init(const std::string&, const Data&);
+%ignore uscxml::JavaDataModel::assign(const Arabica::DOM::Element<std::string>&, const Arabica::DOM::Document<std::string>&, const std::string&);
+%ignore uscxml::JavaDataModel::assign(const std::string&, const Data&);
+%ignore uscxml::JavaDataModel::eval(const Arabica::DOM::Element<std::string>&, const std::string&);
+
%template(DataMap) std::map<std::string, uscxml::Data>;
%template(DataList) std::list<uscxml::Data>;
%template(StringSet) std::set<std::string>;
@@ -80,7 +88,6 @@ using namespace uscxml;
// Parse the header file to generate wrappers
//***********************************************
-#define SWIGIMPORTED 1
%include "../../../uscxml/Factory.h"
%include "../../../uscxml/Message.h"
%include "../../../uscxml/Interpreter.h"
diff --git a/src/uscxml/Factory.cpp b/src/uscxml/Factory.cpp
index 21e820a..22d6008 100644
--- a/src/uscxml/Factory.cpp
+++ b/src/uscxml/Factory.cpp
@@ -491,7 +491,7 @@ void EventHandlerImpl::returnErrorExecution(const std::string& cause) {
Event exceptionEvent;
exceptionEvent.data.compound["exception"] = Data(cause, Data::VERBATIM);
exceptionEvent.name = "error.execution";
- exceptionEvent.type = Event::PLATFORM;
+ exceptionEvent.eventType = Event::PLATFORM;
returnEvent(exceptionEvent);
}
@@ -499,15 +499,15 @@ void EventHandlerImpl::returnErrorPlatform(const std::string& cause) {
Event exceptionEvent;
exceptionEvent.data.compound["exception"] = Data(cause, Data::VERBATIM);
exceptionEvent.name = "error.platform";
- exceptionEvent.type = Event::PLATFORM;
+ exceptionEvent.eventType = Event::PLATFORM;
returnEvent(exceptionEvent);
}
void EventHandlerImpl::returnEvent(Event& event) {
if (event.invokeid.length() == 0)
event.invokeid = _invokeId;
- if (event.type == 0)
- event.type = Event::EXTERNAL;
+ if (event.eventType == 0)
+ event.eventType = Event::EXTERNAL;
if (event.origin.length() == 0)
event.origin = "#_" + _invokeId;
if (event.origintype.length() == 0)
diff --git a/src/uscxml/Interpreter.cpp b/src/uscxml/Interpreter.cpp
index b529f57..a58de6b 100644
--- a/src/uscxml/Interpreter.cpp
+++ b/src/uscxml/Interpreter.cpp
@@ -32,7 +32,7 @@ catch (Event e) {\
throw(e);\
} else {\
e.name = "error.execution";\
- e.type = Event::PLATFORM;\
+ e.eventType = Event::PLATFORM;\
receiveInternal(e);\
}\
}
@@ -577,7 +577,7 @@ void InterpreterImpl::processParamChilds(const Arabica::DOM::Node<std::string>&
void InterpreterImpl::send(const Arabica::DOM::Node<std::string>& element) {
SendRequest sendReq;
// test 331
- sendReq.Event::type = Event::EXTERNAL;
+ sendReq.Event::eventType = Event::EXTERNAL;
try {
// event
if (HAS_ATTR(element, "eventexpr") && _dataModel) {
@@ -776,7 +776,7 @@ void InterpreterImpl::delayedSend(void* userdata, std::string eventName) {
void InterpreterImpl::invoke(const Arabica::DOM::Node<std::string>& element) {
InvokeRequest invokeReq;
- invokeReq.Event::type = Event::EXTERNAL;
+ invokeReq.Event::eventType = Event::EXTERNAL;
try {
// type
if (HAS_ATTR(element, "typeexpr") && _dataModel) {
diff --git a/src/uscxml/Message.cpp b/src/uscxml/Message.cpp
index 266b4be..ddb8996 100644
--- a/src/uscxml/Message.cpp
+++ b/src/uscxml/Message.cpp
@@ -503,7 +503,7 @@ std::ostream& operator<< (std::ostream& os, const Event& event) {
indent += " ";
}
- os << indent << (event.type == Event::EXTERNAL ? "External" : "Internal") << " Event " << (event.dom ? "with DOM attached" : "") << std::endl;
+ os << indent << (event.eventType == Event::EXTERNAL ? "External" : "Internal") << " Event " << (event.dom ? "with DOM attached" : "") << std::endl;
if (event.name.size() > 0)
os << indent << " name: " << event.name << std::endl;
diff --git a/src/uscxml/Message.h b/src/uscxml/Message.h
index ed481e2..1e7a7ca 100644
--- a/src/uscxml/Message.h
+++ b/src/uscxml/Message.h
@@ -112,10 +112,7 @@ protected:
protected:
Arabica::DOM::Document<std::string> toNode(const Arabica::DOM::Document<std::string>& factory, const Data& data);
-
-#ifndef SWIG
friend std::ostream& operator<< (std::ostream& os, const Data& data);
-#endif
};
class Event {
@@ -126,9 +123,9 @@ public:
PLATFORM = 3
};
- Event() : type(INTERNAL), hideSendId(false) {}
- Event(const std::string& name, Type type = INTERNAL) : name(name), type(type), hideSendId(false) {}
- Event(const Arabica::DOM::Node<std::string>& xmlString) : type(INTERNAL), hideSendId(false) {};
+ Event() : eventType(INTERNAL), hideSendId(false) {}
+ Event(const std::string& name, Type type = INTERNAL) : name(name), eventType(type), hideSendId(false) {}
+ Event(const Arabica::DOM::Node<std::string>& xmlString) : eventType(INTERNAL), hideSendId(false) {};
bool operator< (const Event& other) const {
return this < &other;
}
@@ -140,11 +137,11 @@ public:
this->name = name;
}
- Type getType() {
- return type;
+ Type getEventType() {
+ return eventType;
}
- void setType(const Type type) {
- this->type = type;
+ void setEventType(const Type type) {
+ this->eventType = type;
}
std::string getOrigin() {
@@ -225,52 +222,12 @@ public:
return ss.str();
}
-#ifdef SWIG
- /// TODO: Do we want to set namelist and params as well?
- std::map<std::string, std::string> getNameList() {
- return namelist;
- }
-
- const std::vector<std::string> getNameListKeys() {
- std::set<std::string> keys;
- namelist_t::const_iterator nameListIter = namelist.begin();
- while (nameListIter != namelist.end()) {
- keys.insert(nameListIter->first);
- nameListIter++;
- }
- return std::vector<std::string>(keys.begin(), keys.end());
- }
-
- // substitute multimap by map with vectors for language bindings
- std::map<std::string, std::vector<std::string> > getParams() {
- std::map<std::string, std::vector<std::string> > paramsMap;
- params_t::iterator paramIter = params.begin();
- while(paramIter != params.end()) {
- paramsMap[paramIter->first].push_back(paramIter->second);
- paramIter++;
- }
- return paramsMap;
- }
-
- const std::vector<std::string> getParamKeys() {
- std::set<std::string> keys;
- params_t::iterator paramIter = params.begin();
- while(paramIter != params.end()) {
- keys.insert(paramIter->first);
- paramIter++;
- }
- return std::vector<std::string>(keys.begin(), keys.end());
- }
-
-#else
std::map<std::string, std::string>& getNameList() {
return namelist;
}
std::multimap<std::string, std::string>& getParams() {
return params;
}
-#endif
-
#ifdef SWIGIMPORTED
protected:
@@ -279,7 +236,7 @@ protected:
std::string raw;
std::string xml;
std::string name;
- Type type;
+ Type eventType;
std::string origin;
std::string origintype;
Arabica::DOM::Document<std::string> dom;
@@ -294,9 +251,7 @@ protected:
typedef std::multimap<std::string, std::string> params_t;
typedef std::map<std::string, std::string> namelist_t;
-#ifndef SWIG
friend std::ostream& operator<< (std::ostream& os, const Event& event);
-#endif
};
class InvokeRequest : public Event {
@@ -340,9 +295,7 @@ protected:
std::string src;
bool autoForward;
-#ifndef SWIG
friend std::ostream& operator<< (std::ostream& os, const InvokeRequest& sendReq);
-#endif
};
@@ -388,9 +341,7 @@ protected:
std::string type;
uint32_t delayMs;
-#ifndef SWIG
friend std::ostream& operator<< (std::ostream& os, const SendRequest& sendReq);
-#endif
};
diff --git a/src/uscxml/interpreter/InterpreterDraft6.cpp b/src/uscxml/interpreter/InterpreterDraft6.cpp
index 0c82f8b..aa09b53 100644
--- a/src/uscxml/interpreter/InterpreterDraft6.cpp
+++ b/src/uscxml/interpreter/InterpreterDraft6.cpp
@@ -246,7 +246,7 @@ void InterpreterDraft6::mainEventLoop() {
#if VERBOSE
std::cout << "Received externalEvent event " << _currEvent.name << std::endl;
#endif
- _currEvent.type = Event::EXTERNAL; // make sure it is set to external
+ _currEvent.eventType = Event::EXTERNAL; // make sure it is set to external
if (!_running)
goto EXIT_INTERPRETER;
diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDataModel.cpp b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDataModel.cpp
index 2c877b2..7f6a9e7 100644
--- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDataModel.cpp
+++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDataModel.cpp
@@ -509,7 +509,7 @@ void JSCDataModel::handleException(JSValueRef exception) {
Event exceptionEvent;
exceptionEvent.data.compound["exception"] = Data(exceptionMsg, Data::VERBATIM);
exceptionEvent.name = "error.execution";
- exceptionEvent.type = Event::PLATFORM;
+ exceptionEvent.eventType = Event::PLATFORM;
throw(exceptionEvent);
diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCSCXMLEvent.cpp b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCSCXMLEvent.cpp
index de3a93f..579012b 100644
--- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCSCXMLEvent.cpp
+++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCSCXMLEvent.cpp
@@ -7,7 +7,7 @@ namespace DOM {
JSClassRef JSCSCXMLEvent::Tmpl;
JSStaticValue JSCSCXMLEvent::staticValues[] = {
- { "type", typeCustomAttrGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly },
+ { "eventType", eventTypeCustomAttrGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly },
{ "name", nameAttrGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly },
{ "origin", originAttrGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly },
{ "origintype", origintypeAttrGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly },
diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCSCXMLEvent.h b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCSCXMLEvent.h
index 306e563..8e00401 100644
--- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCSCXMLEvent.h
+++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCSCXMLEvent.h
@@ -39,7 +39,7 @@ public:
JSC_DESTRUCTOR(JSCSCXMLEventPrivate);
- static JSValueRef typeCustomAttrGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception);
+ static JSValueRef eventTypeCustomAttrGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception);
static JSValueRef nameAttrGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception);
static JSValueRef originAttrGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception);
static JSValueRef origintypeAttrGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception);
diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCSCXMLEventCustom.cpp b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCSCXMLEventCustom.cpp
index 1033034..0209467 100644
--- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCSCXMLEventCustom.cpp
+++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCSCXMLEventCustom.cpp
@@ -3,11 +3,11 @@
namespace Arabica {
namespace DOM {
-JSValueRef JSCSCXMLEvent::typeCustomAttrGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception) {
+JSValueRef JSCSCXMLEvent::eventTypeCustomAttrGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception) {
struct JSCSCXMLEventPrivate* privData = (struct JSCSCXMLEventPrivate*)JSObjectGetPrivate(thisObj);
JSStringRef stringRef;
- switch (privData->nativeObj->type) {
+ switch (privData->nativeObj->eventType) {
case uscxml::Event::INTERNAL:
stringRef = JSStringCreateWithUTF8CString("internal");
break;
diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCXPathResultCustom.cpp b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCXPathResultCustom.cpp
index 90abfa3..7ef2755 100644
--- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCXPathResultCustom.cpp
+++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCXPathResultCustom.cpp
@@ -5,24 +5,22 @@ namespace Arabica {
namespace DOM {
JSValueRef JSCXPathResult::singleNodeValueCustomAttrGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception) {
-#if 0
- v8::Local<v8::Object> self = info.Holder();
- V8XPathResultPrivate* privData = V8DOM::toClassPtr<V8XPathResultPrivate >(self->GetInternalField(0));
+ struct JSCXPathResultPrivate* privData = (struct JSCXPathResultPrivate*)JSObjectGetPrivate(thisObj);
- Arabica::DOM::Node<std::string>* retVal = new Arabica::DOM::Node<std::string>(privData->nativeObj->asNodeSet()[0]);
+ Arabica::XPath::NodeSet<std::string> nodeSet = privData->nativeObj->asNodeSet();
+ if (nodeSet.size() == 0)
+ return JSValueMakeUndefined(ctx);
- v8::Handle<v8::Function> retCtor = V8Node::getTmpl()->GetFunction();
- v8::Persistent<v8::Object> retObj = v8::Persistent<v8::Object>::New(retCtor->NewInstance());
+ Arabica::DOM::Node<std::string>* retVal = new Arabica::DOM::Node<std::string>(nodeSet[0]);
+ JSClassRef retClass = JSCNode::getTmpl();
- struct V8Node::V8NodePrivate* retPrivData = new V8Node::V8NodePrivate();
+ struct JSCNode::JSCNodePrivate* retPrivData = new JSCNode::JSCNodePrivate();
retPrivData->dom = privData->dom;
retPrivData->nativeObj = retVal;
- retObj->SetInternalField(0, V8DOM::toExternal(retPrivData));
+ JSObjectRef retObj = JSObjectMake(ctx, retClass, retPrivData);
- retObj.MakeWeak(0, V8Node::jsDestructor);
return retObj;
-#endif
}
}
diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.cpp b/src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.cpp
index f912455..b394171 100644
--- a/src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.cpp
+++ b/src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.cpp
@@ -558,7 +558,7 @@ void V8DataModel::throwExceptionEvent(const v8::TryCatch& tryCatch) {
assert(tryCatch.HasCaught());
Event exceptionEvent;
exceptionEvent.name = "error.execution";
- exceptionEvent.type = Event::PLATFORM;
+ exceptionEvent.eventType = Event::PLATFORM;
std::string exceptionString(*v8::String::AsciiValue(tryCatch.Exception()));
exceptionEvent.data.compound["exception"] = Data(exceptionString, Data::VERBATIM);;
diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8SCXMLEvent.h b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8SCXMLEvent.h
index 670d818..8b71ed7 100644
--- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8SCXMLEvent.h
+++ b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8SCXMLEvent.h
@@ -41,7 +41,7 @@ public:
static bool hasInstance(v8::Handle<v8::Value>);
- static v8::Handle<v8::Value> typeCustomAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info);
+ static v8::Handle<v8::Value> eventTypeCustomAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info);
static v8::Handle<v8::Value> nameAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info);
static v8::Handle<v8::Value> originAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info);
static v8::Handle<v8::Value> origintypeAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info);
@@ -63,7 +63,7 @@ public:
instance->SetInternalFieldCount(1);
- instance->SetAccessor(v8::String::NewSymbol("type"), V8SCXMLEvent::typeCustomAttrGetter, 0,
+ instance->SetAccessor(v8::String::NewSymbol("eventType"), V8SCXMLEvent::eventTypeCustomAttrGetter, 0,
v8::External::New(0), static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None));
instance->SetAccessor(v8::String::NewSymbol("name"), V8SCXMLEvent::nameAttrGetter, 0,
v8::External::New(0), static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None));
diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8SCXMLEventCustom.cpp b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8SCXMLEventCustom.cpp
index 4eecb94..d02a4cb 100644
--- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8SCXMLEventCustom.cpp
+++ b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8SCXMLEventCustom.cpp
@@ -3,11 +3,11 @@
namespace Arabica {
namespace DOM {
-v8::Handle<v8::Value> V8SCXMLEvent::typeCustomAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info) {
+v8::Handle<v8::Value> V8SCXMLEvent::eventTypeCustomAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info) {
v8::Local<v8::Object> self = info.Holder();
V8SCXMLEventPrivate* privData = V8DOM::toClassPtr<V8SCXMLEventPrivate >(self->GetInternalField(0));
- switch (privData->nativeObj->type) {
+ switch (privData->nativeObj->eventType) {
case uscxml::Event::INTERNAL:
return v8::String::New("internal");
break;
diff --git a/src/uscxml/plugins/datamodel/prolog/swi/SWIDataModel.cpp b/src/uscxml/plugins/datamodel/prolog/swi/SWIDataModel.cpp
index a52af4b..4a1ce05 100644
--- a/src/uscxml/plugins/datamodel/prolog/swi/SWIDataModel.cpp
+++ b/src/uscxml/plugins/datamodel/prolog/swi/SWIDataModel.cpp
@@ -202,7 +202,7 @@ void SWIDataModel::setEvent(const Event& event) {
// event.type
std::string type;
- switch (event.type) {
+ switch (event.eventType) {
case Event::PLATFORM:
type = "platform";
break;
diff --git a/src/uscxml/plugins/datamodel/xpath/XPathDataModel.cpp b/src/uscxml/plugins/datamodel/xpath/XPathDataModel.cpp
index c38aef3..842c560 100644
--- a/src/uscxml/plugins/datamodel/xpath/XPathDataModel.cpp
+++ b/src/uscxml/plugins/datamodel/xpath/XPathDataModel.cpp
@@ -123,7 +123,7 @@ void XPathDataModel::setEvent(const Event& event) {
// -- type
Element<std::string> eventTypeElem = _doc.createElement("type");
Text<std::string> eventType;
- switch (event.type) {
+ switch (event.eventType) {
case Event::INTERNAL:
eventType = _doc.createTextNode("internal");
break;
diff --git a/src/uscxml/plugins/invoker/umundo/UmundoInvoker.cpp b/src/uscxml/plugins/invoker/umundo/UmundoInvoker.cpp
index a70be38..de5a580 100644
--- a/src/uscxml/plugins/invoker/umundo/UmundoInvoker.cpp
+++ b/src/uscxml/plugins/invoker/umundo/UmundoInvoker.cpp
@@ -94,7 +94,7 @@ void UmundoInvoker::send(const SendRequest& req) {
event.name = _invokeId + ".reply." + req.name;
event.origin = msg.getMeta("um.channel");
event.origintype = "umundo";
- event.type = Event::EXTERNAL;
+ event.eventType = Event::EXTERNAL;
returnEvent(event);
svcIter++;
@@ -230,7 +230,7 @@ void UmundoInvoker::receive(void* object, umundo::Message* msg) {
event.invokeid = _invokeId;
event.origin = msg->getMeta("um.channel");
event.origintype = "umundo";
- event.type = Event::EXTERNAL;
+ event.eventType = Event::EXTERNAL;
// if (msg->getMeta().find("um.s11n.type") != msg->getMeta().end())
// event.compound["class"] = msg->getMeta("um.s11n.type");
@@ -268,7 +268,7 @@ void UmundoInvoker::added(umundo::ServiceDescription desc) {
addedEvent.invokeid = _invokeId;
addedEvent.origin = desc.getName();
addedEvent.origintype = "umundo";
- addedEvent.type = Event::EXTERNAL;
+ addedEvent.eventType = Event::EXTERNAL;
addedEvent.name = _invokeId + ".added";
std::map<std::string, std::string>::const_iterator propIter = desc.getProperties().begin();
@@ -294,7 +294,7 @@ void UmundoInvoker::removed(umundo::ServiceDescription desc) {
addedEvent.invokeid = _invokeId;
addedEvent.origin = desc.getName();
addedEvent.origintype = "umundo";
- addedEvent.type = Event::EXTERNAL;
+ addedEvent.eventType = Event::EXTERNAL;
addedEvent.name = _invokeId + ".removed";
std::map<std::string, std::string>::const_iterator propIter = desc.getProperties().begin();
diff --git a/src/uscxml/plugins/ioprocessor/basichttp/BasicHTTPIOProcessor.cpp b/src/uscxml/plugins/ioprocessor/basichttp/BasicHTTPIOProcessor.cpp
index a612ee6..56e2523 100644
--- a/src/uscxml/plugins/ioprocessor/basichttp/BasicHTTPIOProcessor.cpp
+++ b/src/uscxml/plugins/ioprocessor/basichttp/BasicHTTPIOProcessor.cpp
@@ -70,7 +70,7 @@ Data BasicHTTPIOProcessor::getDataModelVariables() {
bool BasicHTTPIOProcessor::httpRecvRequest(const HTTPServer::Request& req) {
Event reqEvent = req;
- reqEvent.type = Event::EXTERNAL;
+ reqEvent.eventType = Event::EXTERNAL;
bool scxmlStructFound = false;
if (reqEvent.data.compound["header"].compound.find("Content-Type") != reqEvent.data.compound["header"].compound.end() &&
diff --git a/src/uscxml/plugins/ioprocessor/modality/MMIHTTPIOProcessor.cpp b/src/uscxml/plugins/ioprocessor/modality/MMIHTTPIOProcessor.cpp
index 25e0f8c..67b518c 100644
--- a/src/uscxml/plugins/ioprocessor/modality/MMIHTTPIOProcessor.cpp
+++ b/src/uscxml/plugins/ioprocessor/modality/MMIHTTPIOProcessor.cpp
@@ -39,7 +39,7 @@ boost::shared_ptr<IOProcessorImpl> MMIHTTPIOProcessor::create(InterpreterImpl* i
bool MMIHTTPIOProcessor::httpRecvRequest(const HTTPServer::Request& req) {
Event reqEvent = req;
- reqEvent.type = Event::EXTERNAL;
+ reqEvent.eventType = Event::EXTERNAL;
bool scxmlStructFound = false;
if (reqEvent.data.compound["header"].compound.find("Content-Type") != reqEvent.data.compound["header"].compound.end() &&