This class manages content of a whole (read-only) file. More...
#include <fileManager.h>
Public Member Functions | |
virtual void | beginUse () |
Start using a file. Increments the active reference. | |
virtual void | endUse () |
Stop using a file. Decrement the active reference count. | |
virtual bool | isFileMap () const |
Is the storage a file map ? | |
virtual void | printStatus (std::ostream &out) const |
Print information about the storage object to the specified output stream. | |
void | read (const char *file) |
Protected Member Functions | |
virtual void | clear () |
Freeing the storage allocated. | |
void | doRead (const char *file) |
Read the content of a file into memory. | |
void | doRead (const char *file, off_t b, off_t e) |
Read a portion of a file into memory. | |
void | printBody (std::ostream &out) const |
roFile () | |
Constructor. | |
float | score () const |
The function assigns a score to a file. | |
Friends | |
class | ibis::fileManager |
This class manages content of a whole (read-only) file.
It inherits the basic information stored in fileManager::storage and is intended to process read-only files.
void ibis::fileManager::roFile::clear | ( | ) | [protected, virtual] |
Freeing the storage allocated.
It will only proceed if there is no active reference to it.
Reimplemented from ibis::fileManager::storage.
References ibis::gVerbose.
void ibis::fileManager::roFile::doRead | ( | const char * | file, |
off_t | b, | ||
off_t | e | ||
) | [protected] |
Read a portion of a file into memory.
Do NOT record the name of the file. This is different from the one that read the whole file which automatically records the name of the file.
References ibis::gVerbose, ibis::fileManager::instance(), ibis::fileManager::recordPages(), and UnixOpen.
void ibis::fileManager::roFile::printStatus | ( | std::ostream & | out | ) | const [virtual] |
Print information about the storage object to the specified output stream.
Reimplemented from ibis::fileManager::storage.
Referenced by ibis::fileManager::getFile(), and ibis::fileManager::tryGetFile().
float ibis::fileManager::roFile::score | ( | ) | const [inline, protected] |
The function assigns a score to a file.
It is used by ibis::fileManager::unload to determine what files to remove. Files with the smallest scores are the target for removal.
References ibis::fileManager::storage::nacc, and ibis::fileManager::storage::size().
![]() |