source: PSPA/Interface_Web/trunk/pspaWT/sources/controler/include/sectionToExecute.h @ 480

Last change on this file since 480 was 480, checked in by garnier, 10 years ago

BugFix d un memory leak quand on changeait les debut de section. Amelioration lors des changement de debut de sections

File size: 1.8 KB
Line 
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
9class 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  /**
42   Get the last element of this section
43   */
44  inline abstractElement*  getLastElement() {return elements_.back();};
45 
46  /**
47   Remove the last element of this section
48   */
49  inline void removeLastElement() {return elements_.pop_back();};
50
51  bool insertAfter(abstractElement*,abstractElement*);
52
53  inline void insertAtFirst(abstractElement* abs) {
54    elements_.insert ( elements_.begin() ,abs);
55  };
56
57  inline void removeFirstElement() {
58    elements_.erase(elements_.begin());
59  };
60 
61  inline void insertAtLast(abstractElement* abs) {
62    elements_.push_back(abs);
63  };
64 
65  /** Set the first element of this section.
66   If needed, it will change the last element of the previous section
67   */
68  void setFirstElement(int);
69 
70  private :
71
72  abstractSoftware* software_;
73  dataManager* dataManager_;
74  std::vector< abstractElement* > elements_;
75  sector* sector_;
76};
77#endif
Note: See TracBrowser for help on using the repository browser.