UNIVERS  15.3
UNIVERS base processing software API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Classes | Public Types | Public Member Functions | List of all members
hds::TableDoc Class Referenceabstract

#include <table_doc.hpp>

Classes

class  AbstractItem
 
class  HdrItem
 
class  Item
 

Public Types

enum  ItemType {
  IntegerType = 0, FloatType, DoubleType, StringType,
  InvalidType
}
 

Public Member Functions

 TableDoc (const std::string &name=std::string())
 
virtual ~TableDoc ()
 
virtual size_t rowsNum () const =0
 
virtual size_t colsNum () const =0
 
virtual const HdrItemhdrItem (const size_t col) const =0
 
virtual const AbstractItemitem (const size_t row, const size_t col) const =0
 
virtual bool setItem (const size_t row, const size_t col, const AbstractItem &item)=0
 
virtual bool insertRow (const size_t cur_row)=0
 
virtual bool removeRow (const size_t row)=0
 
virtual bool canInsertRow (const size_t) const
 
virtual bool canRemoveRow (const size_t) const
 
const std::string & name () const
 

Detailed Description

Table data document.

Member Enumeration Documentation

Type of supported items

Enumerator
IntegerType 

int

FloatType 

float

DoubleType 

double

StringType 

std::string

InvalidType 

Not supported table item type.

Constructor & Destructor Documentation

hds::TableDoc::TableDoc ( const std::string &  name = std::string())

Default constructor with it's name provided.

virtual hds::TableDoc::~TableDoc ( )
inlinevirtual

Destroy document.

Member Function Documentation

virtual bool hds::TableDoc::canInsertRow ( const size_t  ) const
inlinevirtual
Check whether row can be inserted. 
Parameters
cur_rowIndex of row the new one to be added before.
Returns
true if row can be inserted, otherwise false.
virtual bool hds::TableDoc::canRemoveRow ( const size_t  ) const
inlinevirtual
Check whether row can be removed. 
Parameters
rowRow to be checked.
Returns
true if row can be removed, otherwise false.
virtual size_t hds::TableDoc::colsNum ( ) const
pure virtual

Get current number of columns.

virtual const HdrItem& hds::TableDoc::hdrItem ( const size_t  col) const
pure virtual

Get header item for provided column.

virtual bool hds::TableDoc::insertRow ( const size_t  cur_row)
pure virtual
Insert new row into the document. All new items should have theirs default types and values.
Parameters
cur_rowIndex of row the new one to be added before. If cur_row is out of range new one should appended at the end of the table.
Returns
true if added correctly or false on error.
virtual const AbstractItem& hds::TableDoc::item ( const size_t  row,
const size_t  col 
) const
pure virtual
Get item for provided column and row. 
Returns
required item or item of invalid type on error, e.g.
Parameters
rowor
colis out of range.
const std::string& hds::TableDoc::name ( ) const

Get name of the document.

virtual bool hds::TableDoc::removeRow ( const size_t  row)
pure virtual
Remove one row with provided index.
Parameters
rowRow to be removed.
Returns
true if row removed correctly or false on error.
virtual size_t hds::TableDoc::rowsNum ( ) const
pure virtual

Get current number of rows.

virtual bool hds::TableDoc::setItem ( const size_t  row,
const size_t  col,
const AbstractItem item 
)
pure virtual
Set item for provided column and row. 
Returns
false if indexes are out of range or item can't be set.

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