1 | #ifndef SECTIONTOEXECUTE_SEEN |
---|
2 | #define SECTIONTOEXECUTE_SEEN |
---|
3 | |
---|
4 | #include "nomDeLogiciel.h" |
---|
5 | #include "abstractElement.h" |
---|
6 | #include "abstractSoftware.h" |
---|
7 | #include "sector.h" |
---|
8 | |
---|
9 | class sectionToExecute |
---|
10 | { |
---|
11 | public : |
---|
12 | |
---|
13 | /** Create a new sectionToExecute and initialize it with the given element and software |
---|
14 | */ |
---|
15 | sectionToExecute(abstractElement*,abstractSoftware*,dataManager*,sector*); |
---|
16 | |
---|
17 | /** Deprecated : To be removed ! */ |
---|
18 | sectionToExecute(abstractElement*, int, abstractElement*, int, abstractSoftware*); |
---|
19 | |
---|
20 | ~sectionToExecute() {;} |
---|
21 | |
---|
22 | inline abstractSoftware* getSoftware() const { |
---|
23 | return software_; |
---|
24 | } |
---|
25 | |
---|
26 | inline void setSoftware(abstractSoftware* soft) { |
---|
27 | software_ = soft; |
---|
28 | } |
---|
29 | |
---|
30 | /** |
---|
31 | Set a software according to the corresponding given string. |
---|
32 | If not found, set a softwareUnknown |
---|
33 | */ |
---|
34 | void setSoftware(std::string); |
---|
35 | |
---|
36 | /** |
---|
37 | Get the vector of elements of this sector |
---|
38 | */ |
---|
39 | inline std::vector< abstractElement* > getElements() {return elements_;}; |
---|
40 | |
---|
41 | inline sector* getSector() const {return sector_;}; |
---|
42 | |
---|
43 | /** |
---|
44 | Get the last element of this section |
---|
45 | */ |
---|
46 | inline abstractElement* getLastElement() {return elements_.back();}; |
---|
47 | |
---|
48 | /** |
---|
49 | Remove the last element of this section |
---|
50 | */ |
---|
51 | inline void removeLastElement() {return elements_.pop_back();}; |
---|
52 | |
---|
53 | bool insertAfter(abstractElement*,abstractElement*); |
---|
54 | |
---|
55 | inline void insertAtFirst(abstractElement* abs) { |
---|
56 | elements_.insert ( elements_.begin() ,abs); |
---|
57 | }; |
---|
58 | |
---|
59 | inline void removeFirstElement() { |
---|
60 | elements_.erase(elements_.begin()); |
---|
61 | }; |
---|
62 | |
---|
63 | inline void insertAtLast(abstractElement* abs) { |
---|
64 | elements_.push_back(abs); |
---|
65 | }; |
---|
66 | |
---|
67 | /** Set the first element of this section. |
---|
68 | If needed, it will change the last element of the previous section |
---|
69 | */ |
---|
70 | void setFirstElement(int); |
---|
71 | |
---|
72 | private : |
---|
73 | |
---|
74 | abstractSoftware* software_; |
---|
75 | dataManager* dataManager_; |
---|
76 | std::vector< abstractElement* > elements_; |
---|
77 | sector* sector_; |
---|
78 | }; |
---|
79 | #endif |
---|