diff options
Diffstat (limited to 'src/bindings/swig/uscxml_beautify.i')
-rw-r--r-- | src/bindings/swig/uscxml_beautify.i | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/src/bindings/swig/uscxml_beautify.i b/src/bindings/swig/uscxml_beautify.i new file mode 100644 index 0000000..52c8ec5 --- /dev/null +++ b/src/bindings/swig/uscxml_beautify.i @@ -0,0 +1,54 @@ +%rename(NativeDataModel) DataModel; +%rename(DataModel) WrappedDataModel; +%rename(NativeDataModelExtension) DataModelExtension; +%rename(DataModelExtension) WrappedDataModelExtension; +%rename(NativeExecutableContent) ExecutableContent; +%rename(ExecutableContent) WrappedExecutableContent; +%rename(NativeInvoker) Invoker; +%rename(Invoker) WrappedInvoker; +%rename(NativeIOProcessor) IOProcessor; +%rename(IOProcessor) WrappedIOProcessor; +%rename(NativeInterpreterMonitor) InterpreterMonitor; +%rename(InterpreterMonitor) WrappedInterpreterMonitor; + +%rename(getInvokersNative) uscxml::Interpreter::getInvokers(); +%rename(getIOProcessorsNative) uscxml::Interpreter::getIOProcessors(); + +%extend uscxml::ErrorEvent { + std::string toString() { + std::stringstream ss; + ss << *self; + return ss.str(); + } +}; + +%extend uscxml::Interpreter { + + std::vector<std::string> getConfiguration() { + std::list<XERCESC_NS::DOMElement*> nativeConfig = self->getConfiguration(); + std::vector<std::string> config; + for (auto state : nativeConfig) { + if (HAS_ATTR(state, "id")) + config.push_back(ATTR(state, "id")); + } + return config; + } + +}; + +%{ + #include <easylogging++.h> +%} + +%extend uscxml::Data { + std::vector<std::string> getCompoundKeys() { + std::vector<std::string> keys; + std::map<std::string, Data>::const_iterator iter = self->compound.begin(); + while(iter != self->compound.end()) { + keys.push_back(iter->first); + iter++; + } + return keys; + } + +}; |