Last change
on this file since 35 was
31,
checked in by rosiere, 17 years ago
|
Class Position qui encapsule la génération des fichiers de positions
|
File size:
1.4 KB
|
Line | |
---|
1 | /* |
---|
2 | * $Id$ |
---|
3 | * |
---|
4 | * [ Description ] |
---|
5 | * |
---|
6 | */ |
---|
7 | |
---|
8 | #include "Behavioural/include/Interface.h" |
---|
9 | #include "Behavioural/include/Entity.h" |
---|
10 | |
---|
11 | namespace morpheo { |
---|
12 | namespace behavioural { |
---|
13 | |
---|
14 | XML Interface::toXML (void) |
---|
15 | { |
---|
16 | XML xml ("interface"); |
---|
17 | |
---|
18 | xml.balise_open_begin ("port"); |
---|
19 | xml. attribut ("name" ,_name ); |
---|
20 | xml. attribut ("direction" ,toString(_direction )); |
---|
21 | xml. attribut ("localisation",toString(_localisation)); |
---|
22 | xml.balise_open_end (); |
---|
23 | xml. text (get_comment()); |
---|
24 | |
---|
25 | if (_list_signal->empty()== false) |
---|
26 | { |
---|
27 | list<Signal>::iterator i = _list_signal->begin(); |
---|
28 | |
---|
29 | while (i != _list_signal->end()) |
---|
30 | { |
---|
31 | xml. insert_XML ((*i).toXML()); |
---|
32 | ++i; |
---|
33 | } |
---|
34 | } |
---|
35 | |
---|
36 | xml.balise_close (); |
---|
37 | |
---|
38 | return xml; |
---|
39 | }; |
---|
40 | |
---|
41 | #ifdef POSITION |
---|
42 | XML Interface::toXML_mapping (void) |
---|
43 | { |
---|
44 | if (_is_map != true) |
---|
45 | throw (ErrorMorpheo ("Interface \""+_name+"\" is never mapped")); |
---|
46 | |
---|
47 | XML xml ("interface"); |
---|
48 | |
---|
49 | xml.singleton_begin ("port_map"); |
---|
50 | xml. attribut ("name" ,_name ); |
---|
51 | xml. attribut ("component",(static_cast<Entity *>(_entity_map ))->_name); |
---|
52 | xml. attribut ("port" ,(static_cast<Interface *>(_interface_map))->_name); |
---|
53 | xml.singleton_end (); |
---|
54 | |
---|
55 | return xml; |
---|
56 | }; |
---|
57 | #endif |
---|
58 | }; // end namespace behavioural |
---|
59 | }; // end namespace morpheo |
---|
Note: See
TracBrowser
for help on using the repository browser.