PageFileManager Class Reference

Heap file manager. More...

#include <PageFileManager.h>

List of all members.

Public Member Functions

ReturnCode createFile (const char *fileName)
 Creates a new page file.
ReturnCode removeFile (const char *fileName)
 Removes (i.e., deletes) a page file.
ReturnCode openFile (const char *fileName, PageFileHandle **fileHandle)
 Opens a page file.
ReturnCode closeFile (PageFileHandle *fileHandle)
 Closes the file and deletes its file handle.

Static Public Member Functions

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

Friends

class HandleCache< PageFileManager, PageFileHandle >


Detailed Description

Heap file manager.

PageFileManager is a low-level component of DavisDB that manages the creation and destruction of paged files. Manipulation of the contents of paged files is done through PageFileHandle objects that are opened and closed via the methods of this class. This is a singleton class.


Member Function Documentation

ReturnCode PageFileManager::createFile ( const char *  fileName  ) 

Creates a new page file.

Parameters:
fileName The name of the file to create.
Creates a new page file. The file must not exist, else the function returns RC_FILE_ALREADY_EXISTS.

ReturnCode PageFileManager::removeFile ( const char *  fileName  ) 

Removes (i.e., deletes) a page file.

Parameters:
fileName The file to remove.
Removes (deletes) the specified file. Returns RC_FILE_NOT_FOUND if the file does not exist. Note, this function does not check whether the file is currently open.

ReturnCode PageFileManager::openFile ( const char *  fileName,
PageFileHandle **  fileHandle 
)

Opens a page file.

Parameters:
fileName The file to open.
fileHandle Out parameter for the file handle.
Opens the specified file, returning a newly allocated FileHandle object in fileHandle. The file must already have been created using createFile (otherwise openFile returns RC_FILE_NOT_FOUND). The file must eventually be closed using closeFile.

ReturnCode PageFileManager::closeFile ( PageFileHandle fileHandle  ) 

Closes the file and deletes its file handle.

Parameters:
fileHandle The file handle to be closed.
Closes the file associated with the specified file handle, and deletes the file handle object. The function fails with return code RC_PAGE_PINNED if the file handle has any pages pinned in the buffer pool. It fails with RC_FILE_NOT_FOUND if the file handle does not correspond to any currently open file.

PageFileManager * PageFileManager::getInstance (  )  [static]

Gets the singleton instance of this class.

Gets the static singleton instance of this class.


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