summaryrefslogtreecommitdiffstats
path: root/src/bindings/swig/uscxml_beautify.i
blob: 8b57e78b1b384a7d156a318efcccea1dc0409737 (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
%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;
	}
};