RecordFileManager Class Reference

Main class for record manager component of DavisDB. More...

#include <RecordFileManager.h>

List of all members.

Public Member Functions

ReturnCode createFile (const char *fileName, uint recordSize)
 Create a new record file.
ReturnCode removeFile (const char *fileName)
 Removes (deletes) a record file.
ReturnCode openFile (const char *fileName, RecordFileHandle **fileHandle)
 Opens an existing record file.
ReturnCode closeFile (RecordFileHandle *fileHandle)
 Closes an open record file.

Static Public Member Functions

static RecordFileManagergetInstance ()
 Gets the singleton instance of this class.


Detailed Description

Main class for record manager component of DavisDB.

The main class for the record manager component of DavisDB. It handles creation, deletion, opening, and closing of record files. This is intended to be a singleton class. Use RecordFileManager::getInstance to obtain a pointer to the singleton instance.


Member Function Documentation

ReturnCode RecordFileManager::createFile ( const char *  fileName,
uint  recordSize 
)

Create a new record file.

Parameters:
fileName The name of the file to create
recordSize The size in bytes of the file's records
Creates a new record file. Returns RC_OK on success, RC_RECORD_TOO_LARGE if the specified record size is too large (e.g., greater than PF_PAGE_SIZE), RC_FILE_ALREADY_EXISTS if a file of the same name already exists, and RC_UNIX if there is an underlying file system error.

ReturnCode RecordFileManager::removeFile ( const char *  fileName  ) 

Removes (deletes) a record file.

Parameters:
fileName The name of the file to delete
Deletes a record file. Returns RC_OK on success, and RC_FILE_NOT_FOUND if the file is not found or cannot be deleted.

ReturnCode RecordFileManager::openFile ( const char *  fileName,
RecordFileHandle **  fileHandle 
)

Opens an existing record file.

Parameters:
fileName The name of the file to open
fileHandle Out parameter used to return the record file handle
Opens an existing record file and returns a new record file handle. Returns RC_OK on success, RC_FILE_NOT_FOUND if the file is not found, RC_UNIX if there is an underlying file system error, and RC_CORRUPT_FILE if the file appears to be corrupt. The file must eventually be closed by a matching call to RecordFileManager::closeFile.

ReturnCode RecordFileManager::closeFile ( RecordFileHandle fileHandle  ) 

Closes an open record file.

Parameters:
fileHandle The record file handle for the open file
Closes an open record file and deallocates its file handle. Returns RC_OK on success, or an error code as described in PageFileManager::closeFile otherwise.

RecordFileManager * RecordFileManager::getInstance (  )  [static]

Gets the singleton instance of this class.

This method is already implemented for you.


The documentation for this class was generated from the following files:

Generated on Mon May 16 17:05:06 2011 by  doxygen 1.5.6