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