VR-Forces Development_Version Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Member Functions | Protected Member Functions | Protected Attributes | Private Types | Private Member Functions
DtVpfTable Class Reference

This class is the table that holds a file from the VPF database. More...

Public Member Functions

 DtVpfTable (const DtFilename &path)
 Constructor takes an absolute path to the table.
virtual ~DtVpfTable ()
 destructor
virtual std::istream & file ()
 a file stream of the file used for reading the table in
virtual const DtFilename & fileName () const
 the name of the table's file
virtual const DtFilename & filePath ()
 the path to the table's file
virtual bool mustSwap () const
 determines if the byte order of the machine and the file match
virtual const DtVpfColumncolumn (const DtString &columnName) const
 returns a column with a given name will throw an exception if there is not a column of the given name
virtual const DtColumnListcolumns () const
 return a pointer to the list of columns
virtual unsigned int numColumns () const
 returns the number of columns that this table has loaded
virtual const DtVpfRowrow (int unsigned rowNumber) const
 returns a row with the given index with thrown an exception if the row does not exist
virtual const DtVpfRowrowById (int unsigned id) const
 returns a row with the given ID (since all rows have IDs) with thrown an exception if the row does not exist
virtual const DtRowListrows () const
 returns a pointer to the list of rows
virtual unsigned int numRows () const
 returns the number of rows that this table has loaded
virtual const DtVpfTableintDescriptionTable () const
 returns the table that contains the integer data descriptions
virtual const DtVpfTablecharDescriptionTable () const
 returns the table that contains the character data descriptions

Protected Member Functions

virtual bool readTable ()
 loads the entire table from disk
virtual bool readHeader ()
 loads the table header from disk
virtual bool readData ()
 loads the table data from disk
virtual void calculateByteOrder ()
 determine the byte order of this machine
virtual bool loadValueDescriptionTable (const DtString &tableName)
 loads the value description table from disk

Protected Attributes

int myHeaderLength
DtByteOrderEnum myFileByteOrder
DtByteOrderEnum myMachineByteOrder
DtString myTableDescription
DtString myNarrativeTableFileName
DtFilename myFileName
DtFilename myFilePath
std::ifstream myFile
std::ifstream::pos_type myFileSize
DtColumnList myColumns
DtRowList myRows
DtVpfTablemyIntDescriptions
DtVpfTablemyCharDescriptions

Private Types

enum  DtByteOrderEnum { LSB, MSB }
 Enumeration for Least Significant Byte or Most Significant byte order. More...

Private Member Functions

 DtVpfTable (const DtVpfTable &table)
 Copy constructor is private to prevent copying.
DtVpfTableoperator= (const DtVpfTable &table)
 Assignment operator is private to prevent copying.

Detailed Description

This class is the table that holds a file from the VPF database.

Member Enumeration Documentation

Enumeration for Least Significant Byte or Most Significant byte order.

Enumerator:
LSB 
MSB 

Constructor & Destructor Documentation

DtVpfTable::DtVpfTable ( const DtVpfTable table)
private

Copy constructor is private to prevent copying.

DtVpfTable::DtVpfTable ( const DtFilename &  path)

Constructor takes an absolute path to the table.

Exceptions
DtInvalidInput if path is incorrect
virtual DtVpfTable::~DtVpfTable ( )
virtual

destructor

Member Function Documentation

DtVpfTable& DtVpfTable::operator= ( const DtVpfTable table)
private

Assignment operator is private to prevent copying.

virtual std::istream& DtVpfTable::file ( )
virtual

a file stream of the file used for reading the table in

Returns
a std::file stream reference
virtual const DtFilename& DtVpfTable::fileName ( ) const
virtual

the name of the table's file

Returns
A DtFilename that contains the tables name
virtual const DtFilename& DtVpfTable::filePath ( )
virtual

the path to the table's file

Returns
A DtFilename that contains the path to the name
virtual bool DtVpfTable::mustSwap ( ) const
virtual

determines if the byte order of the machine and the file match

Returns
a boolean representing that the byte order must be swapped to be used
virtual const DtVpfColumn* DtVpfTable::column ( const DtString columnName) const
virtual

returns a column with a given name will throw an exception if there is not a column of the given name

Returns
a DtVpfColumn pointer to the requested column
Exceptions
DtInvalidInputif the column name does not exist
virtual const DtColumnList* DtVpfTable::columns ( ) const
virtual

return a pointer to the list of columns

Returns
a DtColumnList pointer
virtual unsigned int DtVpfTable::numColumns ( ) const
virtual

returns the number of columns that this table has loaded

Returns
An unsigned integer that represents the number of columns
virtual const DtVpfRow* DtVpfTable::row ( int unsigned  rowNumber) const
virtual

returns a row with the given index with thrown an exception if the row does not exist

Returns
a DtVpfRow pointer that points to the requested row
Exceptions
DtInvalidInputif the row index is out of range
virtual const DtVpfRow* DtVpfTable::rowById ( int unsigned  id) const
virtual

returns a row with the given ID (since all rows have IDs) with thrown an exception if the row does not exist

Returns
a DtVpfRow pointer that points to the requested row
Exceptions
DtInvalidInputif the row index is out of range
virtual const DtRowList* DtVpfTable::rows ( ) const
virtual

returns a pointer to the list of rows

Returns
A DtRowList pointer
virtual unsigned int DtVpfTable::numRows ( ) const
virtual

returns the number of rows that this table has loaded

Returns
An unsigned integer that represents the number of rows
virtual const DtVpfTable* DtVpfTable::intDescriptionTable ( ) const
virtual

returns the table that contains the integer data descriptions

Returns
a DtVpfTable that contains the integer data descriptions
virtual const DtVpfTable* DtVpfTable::charDescriptionTable ( ) const
virtual

returns the table that contains the character data descriptions

Returns
a DtVpfTable that contains the character data descriptions
virtual bool DtVpfTable::readTable ( )
protectedvirtual

loads the entire table from disk

Returns
A boolean that indicates the success or failure of the load
virtual bool DtVpfTable::readHeader ( )
protectedvirtual

loads the table header from disk

Returns
A boolean that indicates the success or failure of the load
virtual bool DtVpfTable::readData ( )
protectedvirtual

loads the table data from disk

Returns
A boolean that indicates the success or failure of the load
virtual void DtVpfTable::calculateByteOrder ( )
protectedvirtual

determine the byte order of this machine

virtual bool DtVpfTable::loadValueDescriptionTable ( const DtString tableName)
protectedvirtual

loads the value description table from disk

Returns
A boolean that indicates the success or failure of the load

Member Data Documentation

int DtVpfTable::myHeaderLength
protected
DtByteOrderEnum DtVpfTable::myFileByteOrder
protected
DtByteOrderEnum DtVpfTable::myMachineByteOrder
protected
DtString DtVpfTable::myTableDescription
protected
DtString DtVpfTable::myNarrativeTableFileName
protected
DtFilename DtVpfTable::myFileName
protected
DtFilename DtVpfTable::myFilePath
protected
std::ifstream DtVpfTable::myFile
protected
std::ifstream::pos_type DtVpfTable::myFileSize
protected
DtColumnList DtVpfTable::myColumns
protected
DtRowList DtVpfTable::myRows
protected
DtVpfTable* DtVpfTable::myIntDescriptions
protected
DtVpfTable* DtVpfTable::myCharDescriptions
protected

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

Document ID: Generated on Mon Jul 4 01:00:18 EDT 2016 from SVN revision 166489
Copyright © 2005-2015 VT MÄK. All Rights Reserved (www.mak.com)