Table< DataType > Class Template Reference

#include <Table.h>

Collaboration diagram for Table< DataType >:
Collaboration graph
[legend]

List of all members.

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 TableInfoinSchema () 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
TableInfomInfoPtr
bool mChecked
bool mHasNaNs

template<typename DataType>
class Table< DataType >


Constructor & Destructor Documentation

template<typename DataType>
Table< DataType >::Table ( TableData< DataType > *  aDataPtr,
TableInfo aInfoPtr 
) [inline]

Constructor.

template<typename DataType>
Table< DataType >::~Table (  )  [inline]

Destructor.


Member Function Documentation

template<typename DataType>
void Table< DataType >::bigintTest ( TableData< Numeric > &  aData,
int  aCol 
) [inline, protected]

Do nothing for Numeric.

template<typename DataType >
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().

template<typename DataType >
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().

template<typename DataType>
bool Table< DataType >::checked (  )  const [inline]
template<typename DataType >
bool Table< DataType >::checkRange (  )  [inline]
template<typename DataType>
void Table< DataType >::datetimeTest ( TableData< Numeric > &  aData,
int  aCol,
int  aRow 
) [inline, protected]

Do nothing for Numeric.

template<typename DataType >
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().

template<typename DataType>
bool Table< DataType >::hasNaNs (  )  const [inline]

Referenced by extractMetadata(), and extractSources().

template<typename DataType>
const TableData<DataType>* Table< DataType >::inData (  )  const [inline]
template<typename DataType>
const TableInfo* Table< DataType >::inSchema (  )  const [inline]
template<typename DataType>
bool Table< DataType >::isInf ( Numeric  value  )  const [inline, protected]

check if value is inf

template<typename DataType>
bool Table< DataType >::isInf ( Metadata  value  )  const [inline, protected]

check if value is inf

Referenced by Table< DataType >::checkData().

template<typename DataType>
bool Table< DataType >::isNaN ( Numeric  value  )  const [inline, protected]

check if value is NaN

template<typename DataType>
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().

template<typename DataType >
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.

template<typename DataType>
template<typename ADataType >
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.

template<typename DataType>
void Table< DataType >::varcharTest ( TableData< Numeric > &  aData,
int  aCol,
int  aRow,
unsigned  aLength 
) [inline, protected]

Test is irrelevant for Numeric, therefore passes.

template<typename DataType >
void Table< DataType >::varcharTest ( TableData< Metadata > &  aData,
int  aCol,
int  aRow,
unsigned  aLength 
) [inline, protected]

Member Data Documentation

template<typename DataType>
bool Table< DataType >::mChecked [protected]
template<typename DataType>
TableData<DataType>* Table< DataType >::mDataPtr [protected]
template<typename DataType>
bool Table< DataType >::mHasNaNs [protected]
template<typename DataType>
TableInfo* Table< DataType >::mInfoPtr [protected]

The documentation for this class was generated from the following files:
Generated on Mon Oct 4 10:39:39 2010 for WfcamSrc by  doxygen 1.6.3