1 : |
agomez |
1 |
#ifndef conversionindexptrvector_h
|
2 : |
|
|
#define conversionindexptrvector_h
|
3 : |
|
|
|
4 : |
|
|
class ConversionIndex;
|
5 : |
|
|
|
6 : |
|
|
/**
|
7 : |
|
|
* \class ConversionIndexPtrVector
|
8 : |
|
|
* \brief This class implements a dynamic vector of ConversionIndex values
|
9 : |
|
|
*/
|
10 : |
|
|
class ConversionIndexPtrVector {
|
11 : |
|
|
public:
|
12 : |
|
|
/**
|
13 : |
|
|
* \brief This is the default ConversionIndexPtrVector constructor
|
14 : |
|
|
*/
|
15 : |
|
|
ConversionIndexPtrVector() { size = 0; v = 0; };
|
16 : |
|
|
/**
|
17 : |
|
|
* \brief This is the ConversionIndexPtrVector constructor that creates a copy of an existing ConversionIndexPtrVector
|
18 : |
|
|
* \param initial is the ConversionIndexPtrVector to copy
|
19 : |
|
|
*/
|
20 : |
|
|
ConversionIndexPtrVector(const ConversionIndexPtrVector& initial);
|
21 : |
|
|
/**
|
22 : |
|
|
* \brief This is the ConversionIndexPtrVector destructor
|
23 : |
|
|
* \note This will free all the memory allocated to all the elements of the vector
|
24 : |
|
|
*/
|
25 : |
|
|
~ConversionIndexPtrVector();
|
26 : |
|
|
/**
|
27 : |
|
|
* \brief This will add one new entry to the vector
|
28 : |
|
|
* \param value is the value that will be entered for the new entry
|
29 : |
|
|
*/
|
30 : |
|
|
void resize(ConversionIndex* value);
|
31 : |
|
|
/**
|
32 : |
|
|
* \brief This will delete an entry from the vector
|
33 : |
|
|
* \param pos is the element of the vector to be deleted
|
34 : |
|
|
* \note This will free the memory allocated to the deleted element of the vector
|
35 : |
|
|
*/
|
36 : |
|
|
void Delete(int pos);
|
37 : |
|
|
/**
|
38 : |
|
|
* \brief This will return the size of the vector
|
39 : |
|
|
* \return the size of the vector
|
40 : |
|
|
*/
|
41 : |
|
|
int Size() const { return size; };
|
42 : |
|
|
/**
|
43 : |
|
|
* \brief This will return the value of an element of the vector
|
44 : |
|
|
* \param pos is the element of the vector to be returned
|
45 : |
|
|
* \return the value of the specified element
|
46 : |
|
|
*/
|
47 : |
|
|
ConversionIndex*& operator [] (int pos) { return v[pos]; };
|
48 : |
|
|
/**
|
49 : |
|
|
* \brief This will return the value of an element of the vector
|
50 : |
|
|
* \param pos is the element of the vector to be returned
|
51 : |
|
|
* \return the value of the specified element
|
52 : |
|
|
*/
|
53 : |
|
|
ConversionIndex* const& operator [] (int pos) const { return v[pos]; };
|
54 : |
|
|
protected:
|
55 : |
|
|
/**
|
56 : |
|
|
* \brief This is the vector of ConversionIndex values
|
57 : |
|
|
*/
|
58 : |
|
|
ConversionIndex** v;
|
59 : |
|
|
/**
|
60 : |
|
|
* \brief This is the size of the vector
|
61 : |
|
|
*/
|
62 : |
|
|
int size;
|
63 : |
|
|
};
|
64 : |
|
|
|
65 : |
|
|
#endif
|