Log In | Get Help   
Home My Page Projects Code Snippets Project Openings Mareframe
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files
[mareframe] Annotation of /trunk/gadget/baseclassptrvector.h
[mareframe] / trunk / gadget / baseclassptrvector.h Repository:
ViewVC logotype

Annotation of /trunk/gadget/baseclassptrvector.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1 - (view) (download)

1 : agomez 1 #ifndef baseclassptrvector_h
2 :     #define baseclassptrvector_h
3 :    
4 :     class BaseClass;
5 :    
6 :     /**
7 :     * \class BaseClassPtrVector
8 :     * \brief This class implements a dynamic vector of BaseClass values
9 :     */
10 :     class BaseClassPtrVector {
11 :     public:
12 :     /**
13 :     * \brief This is the default BaseClassPtrVector constructor
14 :     */
15 :     BaseClassPtrVector() { size = 0; v = 0; };
16 :     /**
17 :     * \brief This is the BaseClassPtrVector constructor that creates a copy of an existing BaseClassPtrVector
18 :     * \param initial is the BaseClassPtrVector to copy
19 :     */
20 :     BaseClassPtrVector(const BaseClassPtrVector& initial);
21 :     /**
22 :     * \brief This is the BaseClassPtrVector destructor
23 :     * \note This will free all the memory allocated to all the elements of the vector
24 :     */
25 :     ~BaseClassPtrVector();
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(BaseClass* 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 :     BaseClass*& 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 :     BaseClass* const& operator [] (int pos) const { return v[pos]; };
54 :     protected:
55 :     /**
56 :     * \brief This is the vector of BaseClass values
57 :     */
58 :     BaseClass** v;
59 :     /**
60 :     * \brief This is the size of the vector
61 :     */
62 :     int size;
63 :     };
64 :    
65 :     #endif

root@forge.cesga.es
ViewVC Help
Powered by ViewVC 1.0.0  

Powered By FusionForge