[29] | 1 | /* |
---|
| 2 | * $Id: Interfaces_get_interface.cpp 94 2008-12-15 11:04:03Z rosiere $ |
---|
| 3 | * |
---|
| 4 | * [ Description ] |
---|
| 5 | * |
---|
| 6 | */ |
---|
| 7 | |
---|
| 8 | #include "Behavioural/include/Interfaces.h" |
---|
[94] | 9 | #include "Common/include/Tabulation.h" |
---|
[29] | 10 | |
---|
| 11 | namespace morpheo { |
---|
| 12 | namespace behavioural { |
---|
| 13 | |
---|
[43] | 14 | #undef FUNCTION |
---|
| 15 | #define FUNCTION "Interfaces::get_interface" |
---|
[75] | 16 | std::string Interfaces::get_interface (void) |
---|
[29] | 17 | { |
---|
[43] | 18 | log_printf(FUNC,Behavioural,FUNCTION,"Begin"); |
---|
| 19 | |
---|
[29] | 20 | uint32_t depth = 0; |
---|
[75] | 21 | std::string separator = "\n"; |
---|
[29] | 22 | bool last_separator = false; |
---|
| 23 | |
---|
[75] | 24 | std::list<Interface_fifo*>::iterator i = _list_interface->begin(); |
---|
[31] | 25 | bool empty = _list_interface->empty(); |
---|
[29] | 26 | |
---|
[94] | 27 | std::string tab = morpheo::tab(depth); |
---|
[75] | 28 | std::ostringstream text; |
---|
[29] | 29 | |
---|
| 30 | if (not empty) |
---|
| 31 | { |
---|
| 32 | // First |
---|
[31] | 33 | if (i != _list_interface->end()) |
---|
[29] | 34 | { |
---|
[38] | 35 | text << tab << **i; |
---|
[29] | 36 | ++i; |
---|
| 37 | } |
---|
| 38 | |
---|
[31] | 39 | while (i != _list_interface->end()) |
---|
[29] | 40 | { |
---|
| 41 | text << separator; |
---|
[38] | 42 | text << tab << **i; |
---|
[29] | 43 | ++i; |
---|
| 44 | } |
---|
| 45 | |
---|
| 46 | if (last_separator) |
---|
| 47 | text << separator; |
---|
| 48 | } |
---|
| 49 | |
---|
[43] | 50 | log_printf(FUNC,Behavioural,FUNCTION,"End"); |
---|
| 51 | |
---|
[29] | 52 | return text.str(); |
---|
| 53 | }; |
---|
| 54 | |
---|
[43] | 55 | #undef FUNCTION |
---|
| 56 | #define FUNCTION "Interfaces::get_interface_list" |
---|
[75] | 57 | std::list<Interface_fifo*>* Interfaces::get_interface_list (void) |
---|
[42] | 58 | { |
---|
[43] | 59 | log_printf(FUNC,Behavioural,FUNCTION,"Begin"); |
---|
[75] | 60 | std::list<Interface_fifo*>* _return = _list_interface; |
---|
[43] | 61 | log_printf(FUNC,Behavioural,FUNCTION,"End"); |
---|
| 62 | |
---|
| 63 | return _return; |
---|
[42] | 64 | }; |
---|
| 65 | |
---|
[29] | 66 | }; // end namespace behavioural |
---|
| 67 | }; // end namespace morpheo |
---|