Gadget
baseclassptrvector.h
Go to the documentation of this file.
1 #ifndef baseclassptrvector_h
2 #define baseclassptrvector_h
3 
4 class BaseClass;
5 
11 public:
15  BaseClassPtrVector() { size = 0; v = 0; };
20  BaseClassPtrVector(const BaseClassPtrVector& initial);
30  void resize(BaseClass* value);
36  void Delete(int pos);
41  int Size() const { return size; };
47  BaseClass*& operator [] (int pos) { return v[pos]; };
53  BaseClass* const& operator [] (int pos) const { return v[pos]; };
54 protected:
62  int size;
63 };
64 
65 #endif
This class implements a dynamic vector of BaseClass values.
Definition: baseclassptrvector.h:10
void resize(BaseClass *value)
This will add one new entry to the vector.
Definition: baseclassptrvector.cc:22
BaseClassPtrVector()
This is the default BaseClassPtrVector constructor.
Definition: baseclassptrvector.h:15
int size
This is the size of the vector.
Definition: baseclassptrvector.h:62
void Delete(int pos)
This will delete an entry from the vector.
Definition: baseclassptrvector.cc:37
BaseClass ** v
This is the vector of BaseClass values.
Definition: baseclassptrvector.h:53
int Size() const
This will return the size of the vector.
Definition: baseclassptrvector.h:41
BaseClass *& operator[](int pos)
This will return the value of an element of the vector.
Definition: baseclassptrvector.h:47
~BaseClassPtrVector()
This is the BaseClassPtrVector destructor.
Definition: baseclassptrvector.cc:15
This is the base class for any object that can be dynamically modelled within Gadget.
Definition: base.h:13