summaryrefslogtreecommitdiffstats
path: root/src/uscxml/Message.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/uscxml/Message.h')
-rw-r--r--src/uscxml/Message.h216
1 files changed, 188 insertions, 28 deletions
diff --git a/src/uscxml/Message.h b/src/uscxml/Message.h
index c109063..006d515 100644
--- a/src/uscxml/Message.h
+++ b/src/uscxml/Message.h
@@ -3,6 +3,7 @@
#include <map>
#include <list>
+#include <set>
#include <vector>
#include <string>
@@ -39,6 +40,23 @@ public:
return ss.str();
}
+ std::map<std::string, Data> getCompund() { return compound; }
+ void setCompound(const std::map<std::string, Data>& compound) { this->compound = compound; }
+
+ std::list<Data> getArray() { return array; }
+ void setArray(const std::list<Data>& array) { this->array = array; }
+
+ std::string getAtom() { return atom; }
+ void setAtom(const std::string& atom) { this->atom = atom; }
+
+ Type getType() { return type; }
+ void setType(const Type type) { this->type = type; }
+
+
+#ifdef SWIGIMPORTED
+protected:
+#endif
+
std::map<std::string, Data> compound;
std::list<Data> array;
std::string atom;
@@ -66,14 +84,29 @@ public:
return this < &other;
}
- std::string name;
- Type type;
- std::string origin;
- std::string origintype;
- Arabica::DOM::Node<std::string> dom;
- std::string sendid;
- std::string invokeid;
- Data data;
+ std::string getName() { return name; }
+ void setName(const std::string& name) { this->name = name; }
+
+ Type getType() { return type; }
+ void setType(const Type type) { this->type = type; }
+
+ std::string getOrigin() { return origin; }
+ void setOrigin(const std::string& origin) { this->origin = origin; }
+
+ std::string getOriginType() { return origintype; }
+ void setOriginType(const std::string& originType) { this->origintype = originType; }
+
+ Arabica::DOM::Node<std::string> getDOM() { return dom; }
+ void setDOM(const Arabica::DOM::Node<std::string>& dom) { this->dom = dom; }
+
+ std::string getSendId() { return sendid; }
+ void setSendId(const std::string& sendId) { this->sendid = sendId; }
+
+ std::string getInvokeId() { return invokeid; }
+ void setInvokeId(const std::string& invokeId) { this->invokeid = invokeId; }
+
+ Data getData() { return data; }
+ void setData(const Data& invokeId) { this->data = data; }
static Event fromXML(const std::string& xmlString);
Arabica::DOM::Document<std::string> toDocument();
@@ -83,7 +116,20 @@ public:
return ss.str();
}
-#ifndef SWIGJAVA
+#ifdef SWIGIMPORTED
+protected:
+#endif
+
+ std::string name;
+ Type type;
+ std::string origin;
+ std::string origintype;
+ Arabica::DOM::Node<std::string> dom;
+ std::string sendid;
+ std::string invokeid;
+ Data data;
+
+#ifndef SWIG
friend std::ostream& operator<< (std::ostream& os, const Event& event);
#endif
};
@@ -92,15 +138,58 @@ class InvokeRequest : public Event {
public:
InvokeRequest(Event event) : Event(event) {}
InvokeRequest() {}
- std::string type;
- std::string src;
- std::map<std::string, std::string> namelist;
- typedef std::map<std::string, std::string> namelist_t;
- bool autoForward;
- std::multimap<std::string, std::string> params;
- typedef std::multimap<std::string, std::string> params_t;
+
+ std::string getType() { return type; }
+ void setType(const std::string& type) { this->type = type; }
- std::string content;
+ std::string getSource() { return src; }
+ void setSource(const std::string& src) { this->src = src; }
+
+ std::string getContent() { return content; }
+ void setContent(const std::string& content) { this->content = content; }
+
+ bool isAutoForwarded() { return autoForward; }
+ void setAutoForwarded(bool autoForward) { this->autoForward = autoForward; }
+
+#ifdef SWIG
+ /// TODO: Do we want to set namelist and params as well?
+ std::map<std::string, std::string> getNameList() { return namelist; }
+
+ virtual 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
static InvokeRequest fromXML(const std::string& xmlString);
Arabica::DOM::Document<std::string> toDocument();
@@ -110,7 +199,20 @@ public:
return ss.str();
}
-#ifndef SWIGJAVA
+#ifdef SWIGIMPORTED
+protected:
+#endif
+ std::string type;
+ std::string src;
+ std::string content;
+ bool autoForward;
+ std::map<std::string, std::string> namelist;
+ std::multimap<std::string, std::string> params;
+
+ 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 InvokeRequest& sendReq);
#endif
@@ -120,25 +222,83 @@ class SendRequest : public Event {
public:
SendRequest() {}
SendRequest(Event event) : Event(event) {}
- std::string target;
- std::string type;
- uint32_t delayMs;
- std::map<std::string, std::string> namelist;
- typedef std::map<std::string, std::string> namelist_t;
- std::multimap<std::string, std::string> params;
- typedef std::multimap<std::string, std::string> params_t;
- std::string content;
+
+ std::string getTarget() { return target; }
+ void setTarget(const std::string& target) { this->target = target; }
+
+ std::string getType() { return type; }
+ void setType(const std::string& type) { this->type = type; }
+
+ uint32_t getDelayMs() { return delayMs; }
+ void setDelayMs(uint32_t delayMs) { this->delayMs = delayMs; }
+
+ std::string getContent() { return content; }
+ void setContent(const std::string& content) { this->content = content; }
+
+#ifdef SWIG
+ /// TODO: Do we want to set namelist and params as well?
+ std::map<std::string, std::string> getNameList() { return namelist; }
+
+ virtual 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
static SendRequest fromXML(const std::string& xmlString);
Arabica::DOM::Document<std::string> toDocument();
std::string toXMLString() {
std::stringstream ss;
ss << toDocument();
-// std::cout << ss.str() << std::endl;
+ // std::cout << ss.str() << std::endl;
return ss.str();
}
-#ifndef SWIGJAVA
+#ifdef SWIGIMPORTED
+protected:
+#endif
+ std::string target;
+ std::string type;
+ uint32_t delayMs;
+ std::string content;
+
+ std::map<std::string, std::string> namelist;
+ std::multimap<std::string, std::string> params;
+
+ typedef std::map<std::string, std::string> namelist_t;
+ typedef std::multimap<std::string, std::string> params_t;
+
+#ifndef SWIG
friend std::ostream& operator<< (std::ostream& os, const SendRequest& sendReq);
#endif