VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties 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.

Public Member Functions

 DtVpfTable (const DtFilename &path)
 
virtual ~DtVpfTable ()
 
virtual std::istream & file ()
 
virtual const DtFilename & fileName () const
 
virtual const DtFilename & filePath ()
 
virtual bool mustSwap () const
 
virtual const DtVpfColumn * column (const DtString &columnName) const
 
virtual const DtColumnList * columns () const
 
virtual unsigned int numColumns () const
 
virtual const DtVpfRow * row (int unsigned rowNumber) const
 
virtual const DtVpfRow * rowById (int unsigned id) const
 
virtual const DtRowList * rows () const
 
virtual unsigned int numRows () const
 
virtual const DtVpfTable * intDescriptionTable () const
 
virtual const DtVpfTable * charDescriptionTable () const
 

Protected Member Functions

virtual bool readTable ()
 
virtual bool readHeader ()
 
virtual bool readData ()
 
virtual void calculateByteOrder ()
 
virtual bool loadValueDescriptionTable (const DtString &tableName)
 

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
 
DtVpfTable * myIntDescriptions
 
DtVpfTable * myCharDescriptions
 

Private Types

enum  DtByteOrderEnum { LSB, MSB }
 

Private Member Functions

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

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 Thu Oct 15 21:27:02 EDT 2026 from SVN revision 296421
Copyright © 2005-2026 MAK Technologies. All Rights Reserved (www.mak.com)