1 | /* |
---|
2 | * $Id: Instance_toXML.cpp 131 2009-07-08 18:40:08Z rosiere $ |
---|
3 | * |
---|
4 | * [ Description ] |
---|
5 | * |
---|
6 | */ |
---|
7 | |
---|
8 | #include "Behavioural/Configuration/include/Instance.h" |
---|
9 | #include "Common/include/Basename.h" |
---|
10 | |
---|
11 | namespace morpheo { |
---|
12 | namespace behavioural { |
---|
13 | namespace configuration { |
---|
14 | |
---|
15 | #undef FUNCTION |
---|
16 | #define FUNCTION "Instance::toXML" |
---|
17 | XML Instance::toXML (void) |
---|
18 | { |
---|
19 | XML xml (basename(_filename,false).c_str()); |
---|
20 | xml.filename_extension("cfg"); |
---|
21 | |
---|
22 | xml.balise_open_begin("core"); |
---|
23 | xml.attribut("name",_name); |
---|
24 | xml.balise_open_end (); |
---|
25 | |
---|
26 | for (list_parameters_t::iterator it = _list_parameters->begin(); |
---|
27 | it != _list_parameters->end(); |
---|
28 | ++it) |
---|
29 | xml.insert_XML(it->second->toXML(),1); |
---|
30 | |
---|
31 | for (list_links_t::iterator it1 = _list_links->begin(); |
---|
32 | it1 != _list_links->end(); |
---|
33 | ++it1) |
---|
34 | for (list_link_t::iterator it2 = it1->second.begin(); |
---|
35 | it2 != it1->second.end(); |
---|
36 | ++it2) |
---|
37 | xml.insert_XML(it2->second->toXML(),1); |
---|
38 | |
---|
39 | for (list_components_t::iterator it1 = _list_components->begin(); |
---|
40 | it1 != _list_components->end(); |
---|
41 | ++it1) |
---|
42 | for (list_instances_t::iterator it2 = it1->second.begin(); |
---|
43 | it2 != it1->second.end(); |
---|
44 | ++it2) |
---|
45 | xml.insert_XML(it2->second->toXML(),1); |
---|
46 | |
---|
47 | xml.balise_close(); |
---|
48 | |
---|
49 | return xml; |
---|
50 | } |
---|
51 | |
---|
52 | }; // end namespace configuration |
---|
53 | }; // end namespace behavioural |
---|
54 | }; // end namespace morpheo |
---|