RecordFileScan Class Reference

Class for executing scans of record files. More...

#include <RecordFileScan.h>

List of all members.

Public Member Functions

ReturnCode openScan (RecordFileHandle *fileHandle, AttributeType attrType, int attrLength, int attrOffset, ComparisonOp compOp, void *value)
 Initialize a record file scan.
ReturnCode getNextRecord (Record *record)
 Get the next matching record.
ReturnCode closeScan ()
 Terminate the record file scan.

Detailed Description

Class for executing scans of record files.

This class provides clients the capability to perform scans over the records of a file, where a scan may be based on a specified condition. See method documentation below.


Member Function Documentation

ReturnCode RecordFileScan::closeScan (  ) 

Terminate the record file scan.

Terminate the record file scan. Returns RC_OK on success, and other ReturnCode values otherwise.

ReturnCode RecordFileScan::getNextRecord ( Record record  ) 

Get the next matching record.

Parameters:
record The record will be copied here

Get the next matching record in the file. Returns RC_OK on success, RC_EOF if there are no more matching records, and other ReturnCode values otherwise.

ReturnCode RecordFileScan::openScan ( RecordFileHandle fileHandle,
AttributeType  attrType,
int  attrLength,
int  attrOffset,
ComparisonOp  compOp,
void *  value 
)

Initialize a record file scan.

Parameters:
fileHandle The handle to the record file to be scanned
attrType The type of the attribute being compared
attrLength The length in bytes of the attribute being compared
attrOffset The offset in the record of the attribute being compared
compOp The comparison operation to use
value The value with which to compare

Opens a scan of the record file referred to by parameter fileHandle. Returns RC_OK on success, and other ReturnCode values otherwise. During the scan, only the records satisfying the specified condition (a comparison with a value) should be retrieved. If the value parameter is a null pointer, then there is no condition and all records are retrieved during the scan. If the value parameter is not a null pointer, then it points to the value that attributes are to be compared with.

Parameters attrType and attrLength indicate the type and length of the attribute being compared: either a 4-byte integer, a 4-byte floating point number, or a character string with a length between 0 and MAX_STRING_LEN. You will need to cast "value" into the appropriate type for the attribute (or, in the case of an integer or a float, copy it into a separate variable to avoid alignment problems). If a character string has length n, then the attribute and the value will each be exactly n bytes long. They will not necessarily be null-terminated. Parameter attrOffset indicates where the attribute is found within the contents of each record. Parameter compOp indicates the way that the record's attribute value should be compared with the value parameter (see comments for ComparisonOp).


The documentation for this class was generated from the following files:
Generated on Sun May 16 23:18:41 2010 for DavisDB by  doxygen 1.6.3