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