1 | /* |
---|
2 | * $Id: Component.cpp 113 2009-04-14 18:39:12Z rosiere $ |
---|
3 | * |
---|
4 | * [ Description ] |
---|
5 | * |
---|
6 | */ |
---|
7 | |
---|
8 | #include "Behavioural/include/Component.h" |
---|
9 | |
---|
10 | namespace morpheo { |
---|
11 | namespace behavioural { |
---|
12 | |
---|
13 | Component::Component (Tusage_t usage): |
---|
14 | _usage (usage) |
---|
15 | { |
---|
16 | log_printf(FUNC,Behavioural,"Component::Component","Begin"); |
---|
17 | _entity = NULL; |
---|
18 | _list_component = new std::list<Tcomponent_t *>; |
---|
19 | log_printf(FUNC,Behavioural,"Component::Component","End"); |
---|
20 | }; |
---|
21 | |
---|
22 | Component::Component (const Component & component): |
---|
23 | _usage (component._usage) |
---|
24 | { |
---|
25 | log_printf(FUNC,Behavioural,"Component::Component (copy)","Begin"); |
---|
26 | _entity = component._entity ; |
---|
27 | _list_component = component._list_component; |
---|
28 | log_printf(FUNC,Behavioural,"Component::Component (copy)","End"); |
---|
29 | }; |
---|
30 | |
---|
31 | Component::~Component () |
---|
32 | { |
---|
33 | log_printf(FUNC,Behavioural,"Component::~Component","Begin"); |
---|
34 | if (_entity != NULL) |
---|
35 | delete _entity; |
---|
36 | while (not _list_component->empty()) |
---|
37 | { |
---|
38 | delete _list_component->front(); |
---|
39 | _list_component->pop_front(); |
---|
40 | } |
---|
41 | delete _list_component; |
---|
42 | log_printf(FUNC,Behavioural,"Component::~Component","End"); |
---|
43 | }; |
---|
44 | |
---|
45 | |
---|
46 | }; // end namespace behavioural |
---|
47 | }; // end namespace morpheo |
---|