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

Annotation of /trunk/gadget/stockptrvector.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1 - (view) (download)

1 : agomez 1 #ifndef stockptrvector_h
2 :     #define stockptrvector_h
3 :    
4 :     class Stock;
5 :    
6 :     /**
7 :     * \class StockPtrVector
8 :     * \brief This class implements a dynamic vector of Stock values
9 :     */
10 :     class StockPtrVector {
11 :     public:
12 :     /**
13 :     * \brief This is the default StockPtrVector constructor
14 :     */
15 :     StockPtrVector() { size = 0; v = 0; };
16 :     /**
17 :     * \brief This is the StockPtrVector constructor that creates a copy of an existing StockPtrVector
18 :     * \param initial is the StockPtrVector to copy
19 :     */
20 :     StockPtrVector(const StockPtrVector& initial);
21 :     /**
22 :     * \brief This is the StockPtrVector destructor
23 :     * \note This will free all the memory allocated to all the elements of the vector
24 :     */
25 :     ~StockPtrVector();
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(Stock* 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 reset the vector
44 :     * \note This will delete every entry from the vector and set the size to zero
45 :     */
46 :     void Reset();
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 :     Stock*& 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 :     Stock* const& operator [] (int pos) const { return v[pos]; };
59 :     /**
60 :     * \brief This operator will set the vector equal to an existing StockPtrVector
61 :     * \param sv is the StockPtrVector to copy
62 :     */
63 :     StockPtrVector& operator = (const StockPtrVector& sv);
64 :     protected:
65 :     /**
66 :     * \brief This is the vector of Stock values
67 :     */
68 :     Stock** v;
69 :     /**
70 :     * \brief This is the size of the vector
71 :     */
72 :     int size;
73 :     };
74 :    
75 :     #endif

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

Powered By FusionForge