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

Annotation of /trunk/gadget/parametervector.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1 - (view) (download)

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

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

Powered By FusionForge