1 | /* |
---|
2 | * $Id$ |
---|
3 | * |
---|
4 | * [ Description ] |
---|
5 | * |
---|
6 | */ |
---|
7 | |
---|
8 | #include "Behavioural/include/Component.h" |
---|
9 | |
---|
10 | namespace morpheo { |
---|
11 | namespace behavioural { |
---|
12 | |
---|
13 | #undef FUNCTION |
---|
14 | #define FUNCTION "Component::test_map" |
---|
15 | bool Component::test_map (void) |
---|
16 | { |
---|
17 | log_printf(FUNC,Behavioural,FUNCTION,"Begin"); |
---|
18 | |
---|
19 | string name = _entity->get_name(); |
---|
20 | bool test_ok = true; |
---|
21 | if (_list_component->empty () == true) |
---|
22 | log_printf(NONE,Behavioural,FUNCTION, "Component \"%s\" is a behavioural description",name.c_str()); |
---|
23 | else |
---|
24 | { |
---|
25 | log_printf(NONE,Behavioural,FUNCTION, "Component \"%s\" is a structural description",name.c_str()); |
---|
26 | |
---|
27 | log_printf(INFO,Behavioural,FUNCTION, "Test port I/O"); |
---|
28 | |
---|
29 | test_ok &= _entity->test_map(true); |
---|
30 | |
---|
31 | log_printf(INFO,Behavioural,FUNCTION, "Test all internal component"); |
---|
32 | |
---|
33 | for (list<Tcomponent_t *>::iterator i= _list_component->begin(); |
---|
34 | i != _list_component->end(); |
---|
35 | ++i) |
---|
36 | test_ok &= (*i)->_entity->test_map(false); |
---|
37 | } |
---|
38 | |
---|
39 | log_printf(FUNC,Behavioural,FUNCTION,"End"); |
---|
40 | |
---|
41 | if (test_ok == false) |
---|
42 | throw (ErrorMorpheo ("<Component::test_map> A lot of port is not connected.")); |
---|
43 | |
---|
44 | return test_ok; |
---|
45 | }; |
---|
46 | |
---|
47 | |
---|
48 | }; // end namespace behavioural |
---|
49 | }; // end namespace morpheo |
---|