Luiza  v03-01
Public Member Functions | List of all members
gloria::GloriaTableColumn Class Referenceabstract

Abstract class. Used for deriving classes with different column types. More...

#include <GloriaTableColumn.h>

Inheritance diagram for gloria::GloriaTableColumn:
gloria::GloriaTableColumnOf< T >

Public Member Functions

string & Name ()
 Column name. Used to address columns in the table.
 
string & Unit ()
 Units for values stored in this column.
 
string & Comment ()
 Column comment, can be used to store additional information.
 
TableColumnTypeType ()
 Column type defining type of elements stored.
 
string TypeName ()
 Column type name (string) for elements stored.
 
virtual int Size ()=0
 Column size (size of vector storing column elements)
 
virtual void Clear ()=0
 Clear column (clear vector of column elements)
 
virtual void AddRow ()=0
 Add empty cell at the end of the column.
 
virtual void Resize (int Nrow)=0
 Resize column to given number of rows.
 
virtual void DeleteRow (int iRow)=0
 Delete given cell.
 
virtual int ValSize (int i)=0
 Returns size of given cell. More...
 
virtual long LongVal (int i, int j=0)=0
 Return value of element stored in given cell as long. More...
 
virtual double DoubleVal (int i, int j=0)=0
 Return value of element stored in given cell as double. More...
 
virtual string StringVal (int i)=0
 Return element stored in given cell as string. More...
 
virtual string StringVal (int i, int j)=0
 Return element stored in given cell as string. More...
 
virtual GloriaTableColumnClone ()=0
 Return pointer to column copy.
 
virtual GloriaTableColumnEmptyClone ()=0
 Return pointer to empty column duplicate.
 
virtual void CopyCellValue (GloriaTableColumn *source, int isource, int itarget=-1)=0
 Copy cell content from other column.
 
virtual long * CreateSortIndex (bool reverse=false)=0
 Generate list of cell indexes ordered by cell value.
 
virtual void SortByIndex (long *index)=0
 Sort column cells according to the index table.
 

Detailed Description

Abstract class. Used for deriving classes with different column types.

This class defines only the column header and no data storage, as the data type is not defined yet. However, we know that the data are stored in a std::vector<> so some virtual methods can already be defined.

Author
A.F.Zarnecki, University of Warsaw, zarne.nosp@m.cki@.nosp@m.fuw.e.nosp@m.du.p.nosp@m.l

Member Function Documentation

virtual double gloria::GloriaTableColumn::DoubleVal ( int  i,
int  j = 0 
)
pure virtual

Return value of element stored in given cell as double.

Can be used for all column types except StringColumn (if this case 0. is returned). Second argument is used only if cell is a vector. Integers are converted to floats.

Implemented in gloria::GloriaTableColumnOf< T >.

virtual long gloria::GloriaTableColumn::LongVal ( int  i,
int  j = 0 
)
pure virtual

Return value of element stored in given cell as long.

Can be used only for LongColumn or LongVectorColumn. For other column types 0 is returned. Second argument is used only if cell is a vector.

Implemented in gloria::GloriaTableColumnOf< T >.

virtual string gloria::GloriaTableColumn::StringVal ( int  i)
pure virtual

Return element stored in given cell as string.

If cell contains a vector all elements are included, separated by space (' '). If unit is defined it is appended at the end of the sting.

Implemented in gloria::GloriaTableColumnOf< T >.

virtual string gloria::GloriaTableColumn::StringVal ( int  i,
int  j 
)
pure virtual

Return element stored in given cell as string.

If cell contains a vector only one vector element (indicated by second argument) is returned. If unit is defined it is appended at the end of the sting.

Implemented in gloria::GloriaTableColumnOf< T >.

virtual int gloria::GloriaTableColumn::ValSize ( int  i)
pure virtual

Returns size of given cell.

Returns:

  • 0 - if row i is not found
  • 1 - if cell is a single number or string
  • size() - if cell is a vector

Implemented in gloria::GloriaTableColumnOf< T >.


The documentation for this class was generated from the following files: