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

Annotation of /trunk/gadget/charptrmatrix.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1 - (view) (download)

1 : agomez 1 #ifndef charptrmatrix_h
2 :     #define charptrmatrix_h
3 :    
4 :     #include "intvector.h"
5 :     #include "charptrvector.h"
6 :    
7 :     /**
8 :     * \class CharPtrMatrix
9 :     * \brief This class implements a dynamic vector of CharPtrVector values
10 :     */
11 :     class CharPtrMatrix {
12 :     public:
13 :     /**
14 :     * \brief This is the default CharPtrMatrix constructor
15 :     */
16 :     CharPtrMatrix() { nrow = 0; v = 0; };
17 :     /**
18 :     * \brief This is the CharPtrMatrix destructor
19 :     * \note This will free all the memory allocated to all the elements of the vector
20 :     */
21 :     ~CharPtrMatrix();
22 :     /**
23 :     * \brief This will add one new empty entry to the vector
24 :     * \note The new element of the vector will be created, and set to zero
25 :     */
26 :     void resize();
27 :     /**
28 :     * \brief This will return the number of columns in row i of the vector
29 :     * \param i is the row of the vector to have the number of columns counted
30 :     * \return the number of columns in row i of the vector
31 :     * \note This is the number of entries in the CharPtrVector that is entry i of the CharPtrMatrix
32 :     */
33 :     int Ncol(int i = 0) const { return v[i]->Size(); };
34 :     /**
35 :     * \brief This will return the number of rows of the vector
36 :     * \return the number of rows of the vector
37 :     */
38 :     int Nrow() const { return nrow; };
39 :     /**
40 :     * \brief This will return the value of an element of the vector
41 :     * \param pos is the element of the vector to be returned
42 :     * \return the value of the specified element
43 :     */
44 :     CharPtrVector& operator [] (int pos) { return *v[pos]; };
45 :     /**
46 :     * \brief This will return the value of an element of the vector
47 :     * \param pos is the element of the vector to be returned
48 :     * \return the value of the specified element
49 :     */
50 :     const CharPtrVector& operator [] (int pos) const { return *v[pos]; };
51 :     protected:
52 :     /**
53 :     * \brief This is number of rows of the vector
54 :     */
55 :     int nrow;
56 :     /**
57 :     * \brief This is the vector of CharPtrVector values
58 :     */
59 :     CharPtrVector** v;
60 :     };
61 :    
62 :     #endif

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

Powered By FusionForge