Public Member Functions | Protected Member Functions | Friends
ibis::fileManager::roFile Class Reference

This class manages content of a whole (read-only) file. More...

#include <fileManager.h>

Inheritance diagram for ibis::fileManager::roFile:
ibis::fileManager::storage

List of all members.

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

Detailed Description

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.

Note:
This class intends to hold a piece of memory managed by ibis::fileManager. If an object of this type is acquired through ibis::fileManager::getFile, the ownership of the object belongs to the file manager, therefore the caller should not delete the object.

Member Function Documentation

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::util::read(), 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().


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

Make It A Bit Faster
Contact us
Disclaimers
FastBit source code
FastBit mailing list archive