diff options
author | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2014-05-14 07:03:59 (GMT) |
---|---|---|
committer | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2014-05-14 07:03:59 (GMT) |
commit | e437da537c85d82e26665837ee7e66a35080eb1e (patch) | |
tree | 89976b139d4244b6c3da581b5fb627b5e78f44ea /src/bindings/swig | |
parent | 0da799e220877b538a492f89f1dd26049d904c12 (diff) | |
download | uscxml-e437da537c85d82e26665837ee7e66a35080eb1e.zip uscxml-e437da537c85d82e26665837ee7e66a35080eb1e.tar.gz uscxml-e437da537c85d82e26665837ee7e66a35080eb1e.tar.bz2 |
More work on Rhino
Diffstat (limited to 'src/bindings/swig')
-rw-r--r-- | src/bindings/swig/java/uscxml.i | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/bindings/swig/java/uscxml.i b/src/bindings/swig/java/uscxml.i index ae20eb3..ab46783 100644 --- a/src/bindings/swig/java/uscxml.i +++ b/src/bindings/swig/java/uscxml.i @@ -96,6 +96,8 @@ using namespace Arabica::DOM; %template(DataList) std::list<uscxml::Data>; %template(StringSet) std::set<std::string>; +%template(ParamPair) std::pair<std::string, uscxml::Data>; +%template(ParamPairVector) std::vector<std::pair<std::string, uscxml::Data> >; %rename Data DataNative; # %typemap(jstype) uscxml::Data "Data" @@ -109,6 +111,23 @@ using namespace Arabica::DOM; %feature("director") uscxml::JavaInvoker; %feature("director") uscxml::JavaDataModel; +// translate param multimap to Map<String, List<Data> > +%rename(getParamsNative) uscxml::Event::getParams(); +%javamethodmodifiers uscxml::Event::getParams() "private"; + +%extend uscxml::Event { + std::vector<std::pair<std::string, Data> > getParamPairs() { + std::vector<std::pair<std::string, Data> > pairs; + std::multimap<std::string, Data>::iterator paramPairIter = self->getParams().begin(); + while(paramPairIter != self->getParams().end()) { + pairs.push_back(*paramPairIter); + paramPairIter++; + } + return pairs; + } +}; + + // Provide an iterable interface for maps // http://stackoverflow.com/questions/9465856/no-iterator-for-java-when-using-swig-with-cs-stdmap |