IndexScan Class Reference
Performs condition-based scans over the entries of an index.
More...
#include <IndexScan.h>
List of all members.
Detailed Description
Performs condition-based scans over the entries of an index.
The IndexScan class is used to perform condition-based scans over the entries of a B+ tree index.
Member Function Documentation
Opens an index scan.
- Parameters:
-
| indexHandle | The handle for the index to be scanned |
| compOp | The comparison operator to be used for the scan |
| value | The typed value to be compared against for the scan |
Opens a condition-based scan over the entries in the open index referred to by parameter indexHandle. Once underway, the scan should produce the record ids of all records whose indexed attribute value compares in the specified way with the specified value. Parameters compOp and value are much as in
RecordFileScan::openScan (including the possibility that compOp is
ComparisonOp::NO_OP and value is a null pointer, indicating a complete scan). The only exception is that for B+ tree scans, you may choose to disallow comparison operator
ComparisonOp::NE_OP (not equal). You will need to use the proper field of the value union type for the attribute, as in
RecordFileScan. Also, as in
IndexHandle::insertEntry, if the indexed attribute is a character string of length n, then you may assume that value is exactly n bytes long (and might not be null-terminated). Returns RC_OK on success, and non-zero RC codes on failure. An open scan should eventually be closed by the client by a call to
IndexScan::closeScan.
Gets the next record matching the selection condition.
- Parameters:
-
| rid | Out parameter for the id of the next matching record |
Gets the next record in the index matching the selection condition for the scan, returning its identifier in the rid out parameter. Returns RC_OK on success, RC_EOF if there are no more matching records, and other RC codes otherwise. You may assume that
IndexManager clients will not close the corresponding open index while a scan is underway.
Closes the index scan.
Terminates the index scan, freeing whatever resources are associated with the scan. Returns RC_OK on succcess, and other RC codes otherwise.
The documentation for this class was generated from the following files: