Tools.h++ Class Reference

Table Of Contents
Persistence
None
Public Constructor
RWBufferedPageHeap(unsigned pgsize, unsigned nbufs=10);
Constructs a buffered page heap with page size pgsize. The number of buffers (each of
size pgsize) that will be allocated on the heap will be nbufs. If there is insufficient
memory to satisfy the request, then the state of the resultant object as returned by member
function isValid() will be FALSE, otherwise, TRUE.
Protected Member Functions
virtual RWBoolean
swapIn(RWHandle h, void* buf) = 0;
virtual RWBoolean
swapOut(RWHandle, h void* buf) = 0;
It is the responsibility of the specializing class to supply definitions for these two pure
virtual functions. Function swapOut() should copy the page with handle h from the buffer
pointed to by buf to the swapping medium. Function swapIn() should copy the page with
handle h into the buffer pointed to by buf.
Public Member Functions
virtual RWHandle
allocate() = 0;
It is the responsibility of the specializing class to supply a definition for this pure virtual
function. The specializing class should allocate a page and return a unique handle for it. It
should return zero if it cannot satisfy the request. The size of the page is set by the
constructor.
virtual
~RWBufferedPageHeap();
Deallocates all internal buffers.
RWBoolean
isValid();
Returns TRUE if self is in a valid state. A possible reason why the object might not be
valid is insufficient memory to allocate the internal buffers.
virtual void
deallocate(RWHandle h);