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
-
ReportInfo( char* file )
- Default Constructor.
-
~ReportInfo()
- destructor
-
int readHeader()
- Attempt to read the file as if it was an NCS binary file.
-
int detectNCSbinary()
- Indicates that the file is an NCS binary Report
-
int readLine()
- Read the next line of text from the file.
-
int moveToTimestep( int timestep )
- Move file pointer to the beginning of the specified timestep.
-
int sendHeader( FILE* fout )
- Send select portions of the header to a client application.
-
int checkCriteria( char* criteria )
- Given criteria - is this report to be included This should use regular expressions as well.
-
int variedLengthCheckCriteria( char* criteria )
- Similar to checkCriteria function, except that any individual field can be of variable length.
-
int getCount()
- Return nunmber of elements this report handles
-
int sendLine( FILE* fout )
- Write the currently held line to the specified file stream.
-
int lessThan( const ReportInfo* RHS, const int order[] ) const
- Determine if this report info object is alphabetically less than another report info object.
-
int greaterThan( const ReportInfo* RHS, const int order[] ) const
- Determine if this report info object is alphabetically greater than another report info object.
-
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.
-
int closeFile()
-
Public Members
-
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
- ReportInfo( char* file )
-
Default Constructor. Opens specified file and calls
readHeader function to determine validity of file.
If file is valid, perform initializations.
- ~ReportInfo()
-
destructor
- int 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)
- int detectNCSbinary()
-
Indicates that the file is an NCS binary Report
- Returns:
- 1 if file is an NCS binary report, 0 otherwise
- int readLine()
-
Read the next line of text from the file. This assumes
that there is data to read.
- int moveToTimestep( int timestep )
-
Move file pointer to the beginning of the specified timestep.
- Parameters:
- timestep - Timestep to advance (rewind) to.
- int 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
- int 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.
- int 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');
- int getCount()
-
Return nunmber of elements this report handles
- int sendLine( FILE* fout )
-
Write the currently held line to the specified file stream.
- Parameters:
- fout - Destination data stream (file or socket based)
- int 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
- int 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
- 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. If this is not a whole number (due to a partial
line at the end), then truncate the value.
- 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?
- int closeFile()
-
- This class has no child classes.
Alphabetic index HTML hierarchy of classes or Java
This page was generated with the help of DOC++.