summaryrefslogtreecommitdiffstats
path: root/src/bindings/swig/uscxml_beautify.i
blob: 8a53fbbc242d003cbed08a5dcc3acf459fe4b0c0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
%rename(NativeDataModel) DataModel;
%rename(DataModel) WrappedDataModel;
%rename(NativeExecutableContent) ExecutableContent;
%rename(ExecutableContent) WrappedExecutableContent;
%rename(NativeInvoker) Invoker;
%rename(Invoker) WrappedInvoker;
%rename(NativeIOProcessor) IOProcessor;
%rename(IOProcessor) WrappedIOProcessor;
%rename(NativeInterpreterMonitor) InterpreterMonitor;
%rename(InterpreterMonitor) WrappedInterpreterMonitor;

%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;
	}
};

%extend uscxml::Interpreter {
	
	std::vector<std::string> getBasicConfiguration() {
		Arabica::XPath::NodeSet<std::string> nativeConfig = self->getBasicConfiguration();
		std::vector<std::string> config;
		for (int i = 0; i < nativeConfig.size(); i++) {
			Arabica::DOM::Element<std::string> elem(nativeConfig[i]);
			config.push_back(elem.getAttribute("id"));
		}
		return config;
	}

	std::vector<std::string> getConfiguration() {
		Arabica::XPath::NodeSet<std::string> nativeConfig = self->getConfiguration();
		std::vector<std::string> config;
		for (int i = 0; i < nativeConfig.size(); i++) {
			Arabica::DOM::Element<std::string> elem(nativeConfig[i]);
			config.push_back(elem.getAttribute("id"));
		}
		return config;
	}
		
	std::vector<std::string> getIOProcessorKeys() {
		std::vector<std::string> keys;
    std::map<std::string, IOProcessor>::const_iterator iter = self->getIOProcessors().begin();
		while(iter != self->getIOProcessors().end()) {
			keys.push_back(iter->first);
			iter++;
		}
		return keys;
	}

	std::vector<std::string> getInvokerKeys() {
		std::vector<std::string> keys;
    std::map<std::string, Invoker>::const_iterator iter = self->getInvokers().begin();
		while(iter != self->getInvokers().end()) {
			keys.push_back(iter->first);
			iter++;
		}
		return keys;
	}

};

%extend uscxml::Data {
	std::vector<std::string> getCompundKeys() {
		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;
	}
};