Luiza  v03-01
Public Member Functions | List of all members
gloria::GloriaTableColumnOf< T > Class Template Reference

Table column class for different content types. More...

#include <GloriaTableColumn.h>

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

Public Member Functions

vector< T > & Data ()
 Direct access to the data stored in the table.
 
T & At (int i)
 Direct access to single cell.
 
T & EmptyVal ()
 Element used to initialize empty cells when new row is added.
 
int Size ()
 Column size (size of vector storing column elements)
 
void Clear ()
 Clear column (clear vector of column elements)
 
void Push_Back (T val)
 Add element to the column.
 
void AddRow ()
 Add empty cell at the end of the column.
 
void Resize (int Nrow)
 Resize column to given number of rows.
 
void DeleteRow (int iRow)
 Delete given cell.
 
int ValSize (int i)
 Returns size of given cell. More...
 
long LongVal (int i, int j=0)
 Return value of element stored in given cell as long. More...
 
double DoubleVal (int i, int j=0)
 Return value of element stored in given cell as double. More...
 
string StringVal (int i)
 Return element stored in given cell as string. More...
 
string StringVal (int i, int j)
 Return element stored in given cell as string. More...
 
GloriaTableColumnClone ()
 Return pointer to column copy.
 
GloriaTableColumnEmptyClone ()
 Return pointer to empty column duplicate.
 
void CopyCellValue (GloriaTableColumn *source, int isource, int itarget=-1)
 Copy cell content from other column.
 
long * CreateSortIndex (bool reverse=false)
 Generate list of cell indexes ordered by cell value.
 
void SortByIndex (long *index)
 Sort column cells according to the index table.
 
- Public Member Functions inherited from gloria::GloriaTableColumn
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.
 

Detailed Description

template<class T>
class gloria::GloriaTableColumnOf< T >

Table column class for different content types.

Member Function Documentation

template<class T >
double gloria::GloriaTableColumnOf< T >::DoubleVal ( int  i,
int  j = 0 
)
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.

Implements gloria::GloriaTableColumn.

template<class T >
long gloria::GloriaTableColumnOf< T >::LongVal ( int  i,
int  j = 0 
)
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.

Implements gloria::GloriaTableColumn.

template<class T >
string gloria::GloriaTableColumnOf< T >::StringVal ( int  i)
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.

Implements gloria::GloriaTableColumn.

template<class T >
string gloria::GloriaTableColumnOf< T >::StringVal ( int  i,
int  j 
)
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.

Implements gloria::GloriaTableColumn.

template<class T >
int gloria::GloriaTableColumnOf< T >::ValSize ( int  i)
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

Implements gloria::GloriaTableColumn.


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