[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 | |
---|
[43] | 14 | #undef FUNCTION |
---|
| 15 | #define FUNCTION "Entity::toXML" |
---|
[31] | 16 | XML Entity::toXML (void) |
---|
| 17 | { |
---|
[43] | 18 | log_printf(FUNC,Behavioural,FUNCTION,"Begin"); |
---|
| 19 | |
---|
[31] | 20 | XML xml (_name); |
---|
| 21 | |
---|
| 22 | xml. balise_open ("comment"); |
---|
| 23 | xml. text (get_comment()); |
---|
| 24 | xml. balise_close (); |
---|
| 25 | xml. balise_open_begin ("entity"); |
---|
| 26 | xml. attribut ("name" ,_name); |
---|
| 27 | xml. attribut ("type" ,_type); |
---|
| 28 | xml. attribut ("schema" ,toString(_schema)); |
---|
| 29 | xml. balise_open_end (); |
---|
| 30 | xml. insert_XML (_interfaces->toXML()); |
---|
| 31 | xml. balise_close (); |
---|
| 32 | |
---|
[43] | 33 | log_printf(FUNC,Behavioural,FUNCTION,"End"); |
---|
| 34 | |
---|
[31] | 35 | return xml; |
---|
| 36 | }; |
---|
| 37 | |
---|
[43] | 38 | #undef FUNCTION |
---|
| 39 | #define FUNCTION "Entity::toXML_mapping" |
---|
[31] | 40 | XML Entity::toXML_mapping (void) |
---|
| 41 | { |
---|
[43] | 42 | log_printf(FUNC,Behavioural,FUNCTION,"Begin"); |
---|
| 43 | |
---|
[31] | 44 | if (_is_map != true) |
---|
| 45 | throw (ErrorMorpheo ("Entity \""+_name+"\" is never mapped")); |
---|
| 46 | |
---|
| 47 | XML xml (_name); |
---|
| 48 | |
---|
| 49 | xml. balise_open_begin ("component"); |
---|
| 50 | xml. attribut ("name" ,_name); |
---|
| 51 | xml. attribut ("type" ,_type); |
---|
| 52 | xml. attribut ("size_x" ,toString(_map_size_x)); |
---|
| 53 | xml. attribut ("size_y" ,toString(_map_size_y)); |
---|
| 54 | xml. attribut ("pos_x" ,toString(_map_pos_x )); |
---|
| 55 | xml. attribut ("pos_y" ,toString(_map_pos_y )); |
---|
| 56 | |
---|
| 57 | xml. balise_open_end (); |
---|
| 58 | try |
---|
| 59 | { |
---|
| 60 | xml. insert_XML (_interfaces->toXML_mapping()); |
---|
| 61 | } |
---|
| 62 | catch (ErrorMorpheo e) |
---|
| 63 | { |
---|
| 64 | throw (ErrorMorpheo("Entity \""+_name+"\" : "+e.what())); |
---|
| 65 | } |
---|
| 66 | xml. balise_close (); |
---|
| 67 | |
---|
[43] | 68 | log_printf(FUNC,Behavioural,FUNCTION,"End"); |
---|
| 69 | |
---|
[31] | 70 | return xml; |
---|
| 71 | }; |
---|
| 72 | |
---|
| 73 | }; // end namespace behavioural |
---|
| 74 | }; // end namespace morpheo |
---|
| 75 | #endif |
---|