Last change
on this file since 36 was
31,
checked in by rosiere, 17 years ago
|
Class Position qui encapsule la génération des fichiers de positions
|
File size:
1.6 KB
|
Rev | Line | |
---|
[31] | 1 | #ifdef POSITION |
---|
| 2 | /* |
---|
| 3 | * $Id$ |
---|
| 4 | * |
---|
| 5 | * [ Description ] |
---|
| 6 | * |
---|
| 7 | */ |
---|
| 8 | |
---|
| 9 | #include "Behavioural/include/Entity.h" |
---|
| 10 | |
---|
| 11 | namespace morpheo { |
---|
| 12 | namespace behavioural { |
---|
| 13 | |
---|
| 14 | XML Entity::toXML (void) |
---|
| 15 | { |
---|
| 16 | XML xml (_name); |
---|
| 17 | |
---|
| 18 | xml. balise_open ("comment"); |
---|
| 19 | xml. text (get_comment()); |
---|
| 20 | xml. balise_close (); |
---|
| 21 | xml. balise_open_begin ("entity"); |
---|
| 22 | xml. attribut ("name" ,_name); |
---|
| 23 | xml. attribut ("type" ,_type); |
---|
| 24 | xml. attribut ("schema" ,toString(_schema)); |
---|
| 25 | xml. balise_open_end (); |
---|
| 26 | xml. insert_XML (_interfaces->toXML()); |
---|
| 27 | xml. balise_close (); |
---|
| 28 | |
---|
| 29 | return xml; |
---|
| 30 | }; |
---|
| 31 | |
---|
| 32 | XML Entity::toXML_mapping (void) |
---|
| 33 | { |
---|
| 34 | if (_is_map != true) |
---|
| 35 | throw (ErrorMorpheo ("Entity \""+_name+"\" is never mapped")); |
---|
| 36 | |
---|
| 37 | XML xml (_name); |
---|
| 38 | |
---|
| 39 | xml. balise_open_begin ("component"); |
---|
| 40 | xml. attribut ("name" ,_name); |
---|
| 41 | xml. attribut ("type" ,_type); |
---|
| 42 | xml. attribut ("size_x" ,toString(_map_size_x)); |
---|
| 43 | xml. attribut ("size_y" ,toString(_map_size_y)); |
---|
| 44 | xml. attribut ("pos_x" ,toString(_map_pos_x )); |
---|
| 45 | xml. attribut ("pos_y" ,toString(_map_pos_y )); |
---|
| 46 | |
---|
| 47 | xml. balise_open_end (); |
---|
| 48 | try |
---|
| 49 | { |
---|
| 50 | xml. insert_XML (_interfaces->toXML_mapping()); |
---|
| 51 | } |
---|
| 52 | catch (ErrorMorpheo e) |
---|
| 53 | { |
---|
| 54 | throw (ErrorMorpheo("Entity \""+_name+"\" : "+e.what())); |
---|
| 55 | } |
---|
| 56 | xml. balise_close (); |
---|
| 57 | |
---|
| 58 | return xml; |
---|
| 59 | }; |
---|
| 60 | |
---|
| 61 | }; // end namespace behavioural |
---|
| 62 | }; // end namespace morpheo |
---|
| 63 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.