Last change
on this file since 125 was
94,
checked in by rosiere, 16 years ago
|
Update document on Vhdl generation.
|
-
Property svn:keywords set to
Id
|
File size:
1.2 KB
|
Rev | Line | |
---|
[31] | 1 | /* |
---|
| 2 | * $Id: Component_get_component.cpp 94 2008-12-15 11:04:03Z rosiere $ |
---|
| 3 | * |
---|
| 4 | * [ Description ] |
---|
| 5 | * |
---|
| 6 | */ |
---|
| 7 | |
---|
[42] | 8 | #include "Behavioural/include/Component.h" |
---|
[94] | 9 | #include "Common/include/Tabulation.h" |
---|
[31] | 10 | |
---|
| 11 | namespace morpheo { |
---|
| 12 | namespace behavioural { |
---|
| 13 | |
---|
[43] | 14 | #undef FUNCTION |
---|
| 15 | #define FUNCTION "Component::get_component" |
---|
| 16 | |
---|
[75] | 17 | std::string Component::get_component (void) |
---|
[31] | 18 | { |
---|
[43] | 19 | log_printf(FUNC,Behavioural,FUNCTION,"Begin"); |
---|
| 20 | |
---|
[31] | 21 | uint32_t depth = 0; |
---|
[75] | 22 | std::string separator = "\n"; |
---|
[31] | 23 | bool last_separator = false; |
---|
| 24 | |
---|
[75] | 25 | std::list<Tcomponent_t *>::iterator i = _list_component->begin(); |
---|
[31] | 26 | bool empty = _list_component->empty(); |
---|
| 27 | |
---|
[94] | 28 | std::string tab=morpheo::tab(depth); |
---|
| 29 | |
---|
[75] | 30 | std::ostringstream text; |
---|
[31] | 31 | |
---|
| 32 | if (not empty) |
---|
| 33 | { |
---|
| 34 | // First |
---|
| 35 | if (i != _list_component->end()) |
---|
| 36 | { |
---|
[57] | 37 | text << tab << *((*i)->_entity); |
---|
[31] | 38 | ++i; |
---|
| 39 | } |
---|
| 40 | |
---|
| 41 | while (i != _list_component->end()) |
---|
| 42 | { |
---|
| 43 | text << separator; |
---|
[57] | 44 | text << tab << *((*i)->_entity); |
---|
[31] | 45 | ++i; |
---|
| 46 | } |
---|
| 47 | |
---|
| 48 | if (last_separator) |
---|
| 49 | text << separator; |
---|
| 50 | } |
---|
| 51 | |
---|
[43] | 52 | log_printf(FUNC,Behavioural,FUNCTION,"End"); |
---|
| 53 | |
---|
[31] | 54 | return text.str(); |
---|
| 55 | }; |
---|
| 56 | |
---|
| 57 | }; // end namespace behavioural |
---|
| 58 | }; // end namespace morpheo |
---|
Note: See
TracBrowser
for help on using the repository browser.