StandardStManAccessor.h

Classes

ROStandardStManAccessor -- Give access to some StandardStMan functions (full description)

class ROStandardStManAccessor : public RODataManAccessor

Interface

Public Members
ROStandardStManAccessor (const Table& aTable, const String& aDataManagerName)
~ROStandardStManAccessor()
ROStandardStManAccessor (const ROStandardStManAccessor& that)
ROStandardStManAccessor& operator= (const ROStandardStManAccessor& that)
void setCacheSize (uInt aSize)
uInt getCacheSize() const
void clearCache()
void showCacheStatistics (ostream& anOs) const
void showBaseStatistics (ostream& anOs) const
void showIndexStatistics (ostream& anOs) const

Description

Review Status

Reviewed By:
UNKNOWN
Date Reviewed:
before2004/08/25
Programs:
Tests:

Prerequisite

Synopsis

The Table system has one or more storage managers underneath. One of these possible storage managers is the StandardStMan. This storage manager uses a cache of buckets. The default cache size is defined when the StandardStMan object was constructed at the time the table was created.

Sometimes it can be useful to change the cache size. E.g. when the table is accessed in a random way, the hit rate may drop when the cache is too small. The class ROStandardStManAccessor makes it possible to change the cache size in a temporary way.
It is also possible to get the cache size.

Furthermore it is possible to show some statistics (about the cache and the internals of SSM classes).

Motivation

In principle a pointer to StandardStMan could be used. However, that would give access to all public functions. Furthermore it could not distinguish between read/write and readonly tables.

Example

This example shows how to set the cache size for the standard storage manager with the name "SSMExample". The cache size is not persistent, i.e. when the same table is reopened at a later time, this cache size is not remembered.
  // Open a table.
  Table table("someName.data");
  // Set the cache size of its standard storage manager SSMExample
  // to 5 buckets.
  ROStandardStManAccessor accessor(table, "SSMExample");
  accessor.setCacheSize (5);

Member Description

ROStandardStManAccessor (const Table& aTable, const String& aDataManagerName)

Construct the object for the data manager in the table. An exception is thrown if the data manager type does not match the type of this ROStandardStManAccessor object.

~ROStandardStManAccessor()

ROStandardStManAccessor (const ROStandardStManAccessor& that)

Copy constructor (reference semantics).

ROStandardStManAccessor& operator= (const ROStandardStManAccessor& that)

Assignment (reference semantics).

void setCacheSize (uInt aSize)

Set the cache size (in buckets) to be used by the storage manager. The cache size given in this way is not persistent. Only the cache size given to the constructors of the Standard storage managers, is persistent.

uInt getCacheSize() const

Get the cache size (in buckets).

void clearCache()

Clear the cache used by this storage manager. It will flush the cache as needed and remove all buckets from it resulting in a drop in memory used.

void showCacheStatistics (ostream& anOs) const

Show the statistics for the cache used by this storage manager.

void showBaseStatistics (ostream& anOs) const

Show the statistics for the base class.

void showIndexStatistics (ostream& anOs) const

Show the statistics for each index used by this storage manager.