#include <RecordFileHandle.h>
Public Member Functions | |
RecordFileHandle () | |
Constructor for RecordFileHandle. | |
~RecordFileHandle () | |
Destructor for RecordFileHandle. | |
ReturnCode | initialize (PageFileHandle *fileHandle) |
Initializes the RecordFileHandle. | |
ReturnCode | getRecord (RecordID *rid, Record *record) |
Gets a record from the file. | |
ReturnCode | insertRecord (char *data, RecordID *rid) |
Inserts a record into the file. | |
ReturnCode | deleteRecord (RecordID *rid) |
Deletes a record from the file. | |
ReturnCode | updateRecord (Record *record) |
Updates the contents of a record. | |
ReturnCode | forcePage (int pageNo) |
Flushes the specified page to disk. | |
ReturnCode | forceAllPages () |
Flushes all dirty pages to disk. | |
PageFileHandle * | getFileHandle () |
Gets the file handle for this record file. | |
uint | getRecordSize () |
Gets the record size for this record file. |
ReturnCode RecordFileHandle::initialize | ( | PageFileHandle * | fileHandle | ) |
Initializes the RecordFileHandle.
fileHandle | The file handle for the underlying page file |
Note, since RecordManager is a singleton class, you may simply ignore the recordMgr parameter in your implementation of this method: the record manager for *every* record file handle is the one returned by RecordManager::getInstance.
ReturnCode RecordFileHandle::getRecord | ( | RecordID * | rid, | |
Record * | record | |||
) |
Gets a record from the file.
rid | The identifier of the desired record | |
record | A Record structure to fill with a copy of the record |
ReturnCode RecordFileHandle::insertRecord | ( | char * | data, | |
RecordID * | rid | |||
) |
Inserts a record into the file.
data | The data for the record | |
rid | Out parameter where the new record identifier is returned |
ReturnCode RecordFileHandle::deleteRecord | ( | RecordID * | rid | ) |
Deletes a record from the file.
rid | The identifier of the record to delete |
ReturnCode RecordFileHandle::updateRecord | ( | Record * | record | ) |
Updates the contents of a record.
record | The new version of the record |
ReturnCode RecordFileHandle::forcePage | ( | int | pageNo | ) |
Flushes the specified page to disk.
pageNo | The number of the page to flush |
ReturnCode RecordFileHandle::forceAllPages | ( | ) |
Flushes all dirty pages to disk.
Flushes all dirty pages to disk. Returns RC_OK on success, or other ReturnCode values as specified in FileHandle::forceAllPages otherwise.
PageFileHandle * RecordFileHandle::getFileHandle | ( | ) |
Gets the file handle for this record file.
Gets the file handle for this record file. Intended to be used by other record manager components such as RecordFileScan that may require page-level access.