class ReportInfo

When the server is providing binary reports taken from the file system, the information gained must be stored so that it is accessible later

Public Methods

[more] ReportInfo( char* file )
Default Constructor.
[more] ~ReportInfo()
destructor
[more]int readHeader()
Attempt to read the file as if it was an NCS binary file.
[more]int detectNCSbinary()
Indicates that the file is an NCS binary Report
[more]int readLine()
Read the next line of text from the file.
[more]int moveToTimestep( int timestep )
Move file pointer to the beginning of the specified timestep.
[more]int sendHeader( FILE* fout )
Send select portions of the header to a client application.
[more]int checkCriteria( char* criteria )
Given criteria - is this report to be included This should use regular expressions as well.
[more]int variedLengthCheckCriteria( char* criteria )
Similar to checkCriteria function, except that any individual field can be of variable length.
[more]int getCount()
Return nunmber of elements this report handles
[more]int sendLine( FILE* fout )
Write the currently held line to the specified file stream.
[more]int lessThan( const ReportInfo* RHS, const int order[] ) const
Determine if this report info object is alphabetically less than another report info object.
[more]int greaterThan( const ReportInfo* RHS, const int order[] ) const
Determine if this report info object is alphabetically greater than another report info object.
[more]int checkAvailable()
See how many time steps exist in total by seeking to the end of the file and calulating how many full data lines exist from the end of the header to the end of the file.
[more]int closeFile()

Public Members

[more] Check to make sure that another full line of data is ready for reading.


Documentation

When the server is providing binary reports taken from the file system, the information gained must be stored so that it is accessible later
o ReportInfo( char* file )
Default Constructor. Opens specified file and calls readHeader function to determine validity of file. If file is valid, perform initializations.

o ~ReportInfo()
destructor

oint readHeader()
Attempt to read the file as if it was an NCS binary file. If it is binary, collect its data and remember the first byte where actual data begins.
Returns:
0 on success, -1 on failure (not NCS binary)

oint detectNCSbinary()
Indicates that the file is an NCS binary Report
Returns:
1 if file is an NCS binary report, 0 otherwise

oint readLine()
Read the next line of text from the file. This assumes that there is data to read.

oint moveToTimestep( int timestep )
Move file pointer to the beginning of the specified timestep.
Parameters:
timestep - Timestep to advance (rewind) to.

oint sendHeader( FILE* fout )
Send select portions of the header to a client application. Data includes: Report Name, Col, Lay, Cell, Cmp, Report On
Parameters:
fout - File stream (over a socket) to the client

oint checkCriteria( char* criteria )
Given criteria - is this report to be included This should use regular expressions as well. Is there already A regular expression library for c++?
Parameters:
criteria - Fixed length string (192 bytes) segmented into 6 sections
Returns:
1 if it meets the criteria otherwise 0.

oint variedLengthCheckCriteria( char* criteria )
Similar to checkCriteria function, except that any individual field can be of variable length. To separte - tokenize on the space (' '), tab ('\t'), and null ('\0');

oint getCount()
Return nunmber of elements this report handles

oint sendLine( FILE* fout )
Write the currently held line to the specified file stream.
Parameters:
fout - Destination data stream (file or socket based)

oint lessThan( const ReportInfo* RHS, const int order[] ) const
Determine if this report info object is alphabetically less than another report info object. This will check all six descriptors (Report Name=0, Report On=1, Column=2, Layer=3, Cell=4, Cmp=5), but the order may vary as the user desires. The order the desriptors are used in the comparison depends on the int array sent. The integers dictate which corresponding descriptor to select first, second, etc. Ex. 3, 5, 4, 2, 1, 0 is sent. The primary sort criteria is based on Layer, the second criteria is cmp, then cell, ...
Parameters:
RHS - The other report info object we are comparing with
order - Integer array dictating the priority of each descriptor in the sorting

oint greaterThan( const ReportInfo* RHS, const int order[] ) const
Determine if this report info object is alphabetically greater than another report info object. This will check all six descriptors (Report Name=0, Report On=1, Column=2, Layer=3, Cell=4, Cmp=5), but the order may vary as the user desires. The order the desriptors are used in the comparison depends on the int array sent. The integers dictate which corresponding descriptor to select first, second, etc. Ex. 3, 5, 4, 2, 1, 0 is sent. The primary sort criteria is based on Layer, the second criteria is cmp, then cell, ...
Parameters:
RHS - The other report info object we are comparing with
order - Integer array dictating the priority of each descriptor in the sorting

oint checkAvailable()
See how many time steps exist in total by seeking to the end of the file and calulating how many full data lines exist from the end of the header to the end of the file. If this is not a whole number (due to a partial line at the end), then truncate the value.

o Check to make sure that another full line of data is ready for reading.
Check to make sure that another full line of data is ready for reading. Should I have a function the adds onto checkAvailable? what would be the advatage? faster?

oint closeFile()


This class has no child classes.

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.