| GlsMap Toolkit 1.10.2

Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
disti::VPFTable Class Reference

`#include <vpf_table.h>`

## Public Types
typedef VPFUtil::PointerArray< VPFDataValue > | Row
typedef VPFUtil::PointerArray< Row > | TableData

## Public Member Functions
| VPFTable (const char *const fname, volatile bool &abortLoad)
| VPFTable (const char *const fname, const VPFTableHeader::ColumnDefinition::Check *const columnCheck, const unsigned int numColumnCheck, volatile bool &abortLoad)
virtual | ~VPFTable ()
const VPFTableHeader * | GetTableHeader (void) const
const TableData * | GetTableData (void) const
unsigned int | GetRowCount (void) const
const VPFDataValue * | GetTableValue (const unsigned int rowNum, const unsigned int colNum) const
bool | IsValid (void) const

## Protected Member Functions
void | Initialize (const char *const fname, volatile bool &abortLoad)
Row * | ReadRow (VPFFile &infile, VPFTableHeader &tableHeader, volatile bool &abortLoad) const
bool | CheckColumn (const unsigned int col, const VPFTableHeader::ColumnDefinition::Check &check, const bool colCanBeNULL=false) const
bool | CheckColumnForeignKey (const unsigned int col, const char *const colName, const bool colCanBeNULL=false) const

## Protected Attributes
VPFUtil::WarningBool | _isValid
VPFTableHeader * | _tableHeader
TableData * | _data

## Detailed Description

encapsulates a VPF table

## Member Typedef Documentation

## ◆ Row

typedef VPFUtil::PointerArray<VPFDataValue> disti::VPFTable::Row

array of VPFDataValue pointers

## ◆ TableData

typedef VPFUtil::PointerArray<Row> disti::VPFTable::TableData

array of Row pointers

## Constructor & Destructor Documentation

## ◆ VPFTable() [1/2]

VPFTable::VPFTable | ( | const char *const | fname,
|  | volatile bool & | abortLoad
| ) |  |

Load the VPF table with the given filename es

Parameters

  fname | filename of VPF table to load
  abortLoad | can be set true by another thread to async abort the load

## ◆ VPFTable() [2/2]

VPFTable::VPFTable | ( | const char *const | fname,
|  | const VPFTableHeader::ColumnDefinition::Check *const | columnCheck,
|  | const unsigned int | numColumnCheck,
|  | volatile bool & | abortLoad
| ) |  |

Load the VPF table with the given filename and ensure that its columns match the columns described by the given column check structures. Check IsValid() to ensure that table was loaded successfully and columns match check structures

Parameters

  fname | filename of VPF table to load
  columnCheck | array of column check structures (!=NULL)
  numColumnCheck | number of check structures in columnCheckArray
  abortLoad | can be set true by another thread to async abort the load

## ◆ ~VPFTable()

VPFTable::~VPFTable | ( |  | ) |
| virtual

Dtor

## Member Function Documentation

## ◆ CheckColumn()

bool VPFTable::CheckColumn | ( | const unsigned int | col,
|  | const VPFTableHeader::ColumnDefinition::Check & | check,
|  | const bool | colCanBeNULL = `false`
| ) |  | const
| protected

Check if a given column definition matches the given column check

Parameters

  col | zero based column number
  check | column check
  colCanBeNULL | [optional, defaults to false] true if column can optionally be a NULL data type and pass this check test

Returns
  true if matches else false

## ◆ CheckColumnForeignKey()

bool VPFTable::CheckColumnForeignKey | ( | const unsigned int | col,
|  | const char *const | colName,
|  | const bool | colCanBeNULL = `false`
| ) |  | const
| protected

Check if a given column definition matches a foreign key definition

Parameters

  col | zero based column number
  colName | name of column
  colCanBeNULL | [optional, defaults to false] true if column can optionally be a NULL data type and pass this check test

Returns
  true if matches else false

## ◆ GetRowCount()

unsigned int disti::VPFTable::GetRowCount | ( | void |  | ) | const
| inline

Get number of rows in table ( shortcut for GetTableData()->GetRowCount() )

Returns
  number of rows in table

## ◆ GetTableData()

const TableData * disti::VPFTable::GetTableData | ( | void |  | ) | const
| inline

Get the data in the table

Returns
  table data else NULL

## ◆ GetTableHeader()

const VPFTableHeader * disti::VPFTable::GetTableHeader | ( | void |  | ) | const
| inline

Get the table header for this table

Returns
  table header for table else NULL

## ◆ GetTableValue()

const VPFDataValue * VPFTable::GetTableValue | ( | const unsigned int | rowNum,
|  | const unsigned int | colNum
| ) |  | const

Get a specific column value from a specific row in the table

Parameters

  rowNum | zero based row number
  colNum | zero based column number

Returns
  data value from table else NULL

## ◆ Initialize()

void VPFTable::Initialize | ( | const char *const | fname,
|  | volatile bool & | abortLoad
| ) |  |
| protected

Initialize instance and load table from file. Used by Ctor

Parameters

  fname | name of file to load
  abortLoad | can be set true by another thread to async abort the load

## ◆ IsValid()

bool disti::VPFTable::IsValid | ( | void |  | ) | const
| inline

Determine if the table was loaded successfully

Returns
  true if loaded else false

## ◆ ReadRow()

VPFTable::Row * VPFTable::ReadRow | ( | VPFFile & | infile,
|  | VPFTableHeader & | tableHeader,
|  | volatile bool & | abortLoad
| ) |  | const
| protected

Read a row of data described by the given table header from the given file

Parameters

  infile | file to read
  tableHeader | table header describing data to read
  abortLoad | can be set true by another thread to async abort the load

Returns
  new row else NULL

## Member Data Documentation

## ◆ _data

TableData* disti::VPFTable::_data
| protected

rows of table data values else NULL

## ◆ _isValid

VPFUtil::WarningBool disti::VPFTable::_isValid
| protected

true if a valid table was loaded else false

## ◆ _tableHeader

VPFTableHeader* disti::VPFTable::_tableHeader
| protected

header for table else NULL

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

- vpf_table.h
- vpf_table.cpp