[58] | 1 | #ifndef SECTIONTOEXECUTE_SEEN |
---|
| 2 | #define SECTIONTOEXECUTE_SEEN |
---|
| 3 | |
---|
| 4 | #include "nomDeLogiciel.h" |
---|
[401] | 5 | #include "abstractElement.h" |
---|
| 6 | #include "abstractSoftware.h" |
---|
[474] | 7 | #include "sector.h" |
---|
[58] | 8 | |
---|
[401] | 9 | class sectionToExecute |
---|
[58] | 10 | { |
---|
[431] | 11 | public : |
---|
[58] | 12 | |
---|
[455] | 13 | /** Create a new sectionToExecute and initialize it with the given element and software |
---|
| 14 | */ |
---|
[474] | 15 | sectionToExecute(abstractElement*,abstractSoftware*,dataManager*,sector*); |
---|
[431] | 16 | |
---|
| 17 | /** Deprecated : To be removed ! */ |
---|
| 18 | sectionToExecute(abstractElement*, int, abstractElement*, int, abstractSoftware*); |
---|
[413] | 19 | |
---|
[431] | 20 | ~sectionToExecute() {;} |
---|
[401] | 21 | |
---|
[431] | 22 | inline abstractSoftware* getSoftware() const { |
---|
[455] | 23 | return software_; |
---|
[431] | 24 | } |
---|
| 25 | |
---|
[469] | 26 | inline void setSoftware(abstractSoftware* soft) { |
---|
[455] | 27 | software_ = soft; |
---|
| 28 | } |
---|
| 29 | |
---|
[469] | 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 | |
---|
[455] | 36 | /** |
---|
| 37 | Get the vector of elements of this sector |
---|
| 38 | */ |
---|
| 39 | inline std::vector< abstractElement* > getElements() {return elements_;}; |
---|
| 40 | |
---|
[482] | 41 | inline sector* getSector() const {return sector_;}; |
---|
| 42 | |
---|
[468] | 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 | |
---|
[455] | 53 | bool insertAfter(abstractElement*,abstractElement*); |
---|
[431] | 54 | |
---|
[480] | 55 | inline void insertAtFirst(abstractElement* abs) { |
---|
[469] | 56 | elements_.insert ( elements_.begin() ,abs); |
---|
| 57 | }; |
---|
[474] | 58 | |
---|
[480] | 59 | inline void removeFirstElement() { |
---|
| 60 | elements_.erase(elements_.begin()); |
---|
| 61 | }; |
---|
| 62 | |
---|
| 63 | inline void insertAtLast(abstractElement* abs) { |
---|
| 64 | elements_.push_back(abs); |
---|
| 65 | }; |
---|
| 66 | |
---|
[474] | 67 | /** Set the first element of this section. |
---|
| 68 | If needed, it will change the last element of the previous section |
---|
| 69 | */ |
---|
[476] | 70 | void setFirstElement(int); |
---|
[469] | 71 | |
---|
[483] | 72 | bool isInside(abstractElement*); |
---|
| 73 | void removeElement(abstractElement*); |
---|
| 74 | |
---|
[455] | 75 | private : |
---|
[431] | 76 | |
---|
[455] | 77 | abstractSoftware* software_; |
---|
[472] | 78 | dataManager* dataManager_; |
---|
[455] | 79 | std::vector< abstractElement* > elements_; |
---|
[474] | 80 | sector* sector_; |
---|
[401] | 81 | }; |
---|
[58] | 82 | #endif |
---|