Gadget
rectangleptrvector.h
Go to the documentation of this file.
1 #ifndef rectangleptrvector_h
2 #define rectangleptrvector_h
3 
4 class Rectangle;
5 
11 public:
15  RectanglePtrVector() { size = 0; v = 0; };
20  RectanglePtrVector(const RectanglePtrVector& initial);
30  void resize(Rectangle* value);
36  void Delete(int pos);
41  int Size() const { return size; };
47  Rectangle*& operator [] (int pos) { return v[pos]; };
53  Rectangle* const& operator [] (int pos) const { return v[pos]; };
54 protected:
62  int size;
63 };
64 
65 #endif
This class implements a dynamic vector of Rectangle values.
Definition: rectangleptrvector.h:10
int Size() const
This will return the size of the vector.
Definition: rectangleptrvector.h:41
int size
This is the size of the vector.
Definition: rectangleptrvector.h:62
RectanglePtrVector()
This is the default RectanglePtrVector constructor.
Definition: rectangleptrvector.h:15
void resize(Rectangle *value)
This will add one new entry to the vector.
Definition: rectangleptrvector.cc:22
Rectangle *& operator[](int pos)
This will return the value of an element of the vector.
Definition: rectangleptrvector.h:47
void Delete(int pos)
This will delete an entry from the vector.
Definition: rectangleptrvector.cc:37
~RectanglePtrVector()
This is the RectanglePtrVector destructor.
Definition: rectangleptrvector.cc:15
Rectangle ** v
This is the vector of Rectangle values.
Definition: rectangleptrvector.h:53
This is the class used to store the co-ordinates and size of an area, used when calculating the migra...
Definition: rectangle.h:11