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/preyptrvector.h
[mareframe] / trunk / gadget / preyptrvector.h Repository:
ViewVC logotype

Annotation of /trunk/gadget/preyptrvector.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1 - (view) (download)

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

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

Powered By FusionForge