#include <Table.h>
Public Member Functions | |
Table (TableData< DataType > *aDataPtr, TableInfo *aInfoPtr) | |
Constructor. | |
~Table () | |
Destructor. | |
void | checkData (bool aThrowExceptions=false) |
bool | checkRange () |
Checks the range of columns in the data. | |
bool | checked () const |
bool | hasNaNs () const |
const TableData< DataType > * | inData () const |
const TableInfo * | inSchema () const |
void | testDump () |
template<typename ADataType > | |
void | valueOf (const std::string &aName, unsigned aRow, ADataType &aValue) const |
Protected Member Functions | |
void | bigintTest (TableData< Metadata > &aData, int aCol) |
void | bigintTest (TableData< Numeric > &aData, int aCol) |
Do nothing for Numeric. | |
void | varcharTest (TableData< Metadata > &aData, int aCol, int aRow, unsigned aLength) |
void | varcharTest (TableData< Numeric > &aData, int aCol, int aRow, unsigned aLength) |
Test is irrelevant for Numeric, therefore passes. | |
void | datetimeTest (TableData< Metadata > &aData, int aCol, int aRow) |
Make sure datetime is in the correct format. | |
void | datetimeTest (TableData< Numeric > &aData, int aCol, int aRow) |
Do nothing for Numeric. | |
bool | isNaN (Metadata value) const |
check if value is NaN for Metadata | |
bool | isInf (Metadata value) const |
check if value is inf | |
bool | isInf (Numeric value) const |
check if value is inf | |
bool | isNaN (Numeric value) const |
check if value is NaN | |
Protected Attributes | |
TableData< DataType > * | mDataPtr |
TableInfo * | mInfoPtr |
bool | mChecked |
bool | mHasNaNs |
Table< DataType >::Table | ( | TableData< DataType > * | aDataPtr, | |
TableInfo * | aInfoPtr | |||
) | [inline] |
Constructor.
void Table< DataType >::bigintTest | ( | TableData< Numeric > & | aData, | |
int | aCol | |||
) | [inline, protected] |
Do nothing for Numeric.
void Table< DataType >::bigintTest | ( | TableData< Metadata > & | aData, | |
int | aCol | |||
) | [inline, protected] |
Test if the input data for Metadata is really of type bigint, otherwise make entry undefined.
References TableData< DataType >::at(), TableData< DataType >::isDefined(), and TableData< DataType >::setundef().
Referenced by Table< DataType >::checkData().
void Table< DataType >::checkData | ( | bool | aThrowExceptions = false |
) | [inline] |
Checks the contents of the data table against the schema. The main purpose of this function is to check for missing values. If a particular entry has no data value assigned to it, the corresponding default value specified in the schema is assigned. If no default is given in the schema in this case, an exception is thrown
References Logger::addError(), Logger::addWarning(), Table< DataType >::bigintTest(), Table< DataType >::datetimeTest(), Options::getArchive(), TableInfo::getDefault(), TableInfo::getFormat(), TableInfo::getName(), TableInfo::getTableName(), Table< DataType >::isInf(), Table< DataType >::isNaN(), Table< DataType >::mChecked, Table< DataType >::mDataPtr, Table< DataType >::mHasNaNs, Table< DataType >::mInfoPtr, StringOps::NumToString(), StringOps::ToLower(), and Table< DataType >::varcharTest().
Referenced by extractMetadata(), and extractSources().
Referenced by Table< DataType >::checkRange(), extractMetadata(), and extractSources().
Checks the range of columns in the data.
References Logger::addError(), Logger::addMessage(), Table< DataType >::checked(), ExpectNames::extNum, TableInfo::getAttNo(), TableInfo::getDiscrValues(), TableInfo::getName(), TableInfo::getRange(), TableInfo::getTableName(), TableInfo::isDetection(), Table< DataType >::mDataPtr, Table< DataType >::mInfoPtr, ExpectNames::seqNum, and StringOps::split().
Referenced by extractMetadata(), and extractSources().
void Table< DataType >::datetimeTest | ( | TableData< Numeric > & | aData, | |
int | aCol, | |||
int | aRow | |||
) | [inline, protected] |
Do nothing for Numeric.
void Table< DataType >::datetimeTest | ( | TableData< Metadata > & | aData, | |
int | aCol, | |||
int | aRow | |||
) | [inline, protected] |
Make sure datetime is in the correct format.
References TableData< DataType >::assign(), TableData< DataType >::at(), and DefaultValues::datetimedef.
Referenced by Table< DataType >::checkData().
Referenced by extractMetadata(), and extractSources().
Referenced by Table< Numeric >::valueOf().
Referenced by Table< Numeric >::valueOf().
bool Table< DataType >::isInf | ( | Numeric | value | ) | const [inline, protected] |
check if value is inf
bool Table< DataType >::isInf | ( | Metadata | value | ) | const [inline, protected] |
check if value is inf
Referenced by Table< DataType >::checkData().
bool Table< DataType >::isNaN | ( | Numeric | value | ) | const [inline, protected] |
check if value is NaN
bool Table< DataType >::isNaN | ( | Metadata | value | ) | const [inline, protected] |
check if value is NaN for Metadata
Referenced by Table< DataType >::checkData(), and Table< Numeric >::isInf().
void Table< DataType >::testDump | ( | ) | [inline] |
Dumps attribute names and associated ingested data to the standard output. This routine is used for diagnostic purposes
References Logger::addMessage(), TableInfo::getName(), TableInfo::getTableName(), Table< DataType >::mDataPtr, and Table< DataType >::mInfoPtr.
void Table< DataType >::valueOf | ( | const std::string & | aName, | |
unsigned | aRow, | |||
ADataType & | aValue | |||
) | const [inline] |
Schema driven retrieval of a table entry by column name and row. If entry does not exist in schema then a schema exception is throw.
void Table< DataType >::varcharTest | ( | TableData< Numeric > & | aData, | |
int | aCol, | |||
int | aRow, | |||
unsigned | aLength | |||
) | [inline, protected] |
Test is irrelevant for Numeric, therefore passes.
void Table< DataType >::varcharTest | ( | TableData< Metadata > & | aData, | |
int | aCol, | |||
int | aRow, | |||
unsigned | aLength | |||
) | [inline, protected] |
Test if the input data for Metadata of type varchar has the right length, otherwise truncate.
References Logger::addWarning(), TableData< DataType >::assign(), TableData< DataType >::at(), TableInfo::getFormat(), TableInfo::getName(), TableInfo::getTableName(), Table< DataType >::mInfoPtr, and StringOps::NumToString().
Referenced by Table< DataType >::checkData().
Referenced by Table< DataType >::checkData(), and Table< Numeric >::checked().
Referenced by Table< DataType >::checkData(), and Table< Numeric >::hasNaNs().