casacore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
casacore::BucketBase Class Referenceabstract

Abstract base class for Bucket classes. More...

#include <BucketBase.h>

Inheritance diagram for casacore::BucketBase:
casacore::BucketBuffered casacore::BucketMapped

Public Member Functions

 BucketBase (BucketFile *file, Int64 startOffset, uInt bucketSize, uInt nrOfBuckets)
 Create the bucket access for (part of) a file. More...
 
virtual ~BucketBase ()
 Detach the file. More...
 
Bool flush ()
 Flush the cached buckets. More...
 
virtual void resync (uInt nrBucket)
 Resynchronize the object (after another process updated the file). More...
 
uInt nBucket () const
 Get the current nr of buckets in the file. More...
 
void extend (uInt nrBucket)
 Extend the file with the given number of buckets. More...
 
void setWritten ()
 Set that data has been written. More...
 

Protected Member Functions

 BucketBase (const BucketBase &)
 Copy constructor is not possible. More...
 
BucketBaseoperator= (const BucketBase &)
 Assignment is not possible. More...
 
virtual void doFlush ()=0
 Do the actual flushing. More...
 
virtual void doResync ()=0
 Do the actual resync-ing. More...
 
virtual void doExtend (uInt nrBucket)=0
 Do the actual extension of the file. More...
 
virtual void initializeBuckets (uInt bucketNr)=0
 Initialize the bucket buffer. More...
 

Protected Attributes

BucketFileitsFile
 The file used. More...
 
Int64 itsStartOffset
 The starting offsets of the buckets in the file. More...
 
uInt itsBucketSize
 The bucket size. More...
 
uInt itsCurNrOfBuckets
 The current nr of buckets in the file. More...
 
uInt itsNewNrOfBuckets
 The new nr of buckets in the file (after extension). More...
 
Bool itsHasWritten
 Have data been written? More...
 

Detailed Description

Abstract base class for Bucket classes.

Intended use:

Internal

Review Status

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

Prerequisite

Synopsis

BucketBase is the abstract baseclass for the various Bucket classes like BucketMapped and BucketBuffered. It is used by TSMCube to do the IO in the required way.

Definition at line 59 of file BucketBase.h.

Constructor & Destructor Documentation

casacore::BucketBase::BucketBase ( BucketFile file,
Int64  startOffset,
uInt  bucketSize,
uInt  nrOfBuckets 
)

Create the bucket access for (part of) a file.

The file part starts at startOffset. Its length is bucketSize*nrOfBuckets bytes. If the file is smaller, the remainder is indicated as an extension similarly to the behaviour of function extend.

virtual casacore::BucketBase::~BucketBase ( )
virtual

Detach the file.

The BucketFile is not closed.

casacore::BucketBase::BucketBase ( const BucketBase )
protected

Copy constructor is not possible.

Member Function Documentation

virtual void casacore::BucketBase::doExtend ( uInt  nrBucket)
protectedpure virtual

Do the actual extension of the file.

Note that itsNewNrOfBuckets has been increased before doExtend is called.

Implemented in casacore::BucketMapped, and casacore::BucketBuffered.

virtual void casacore::BucketBase::doFlush ( )
protectedpure virtual

Do the actual flushing.

Implemented in casacore::BucketMapped, and casacore::BucketBuffered.

virtual void casacore::BucketBase::doResync ( )
protectedpure virtual

Do the actual resync-ing.

Implemented in casacore::BucketMapped, and casacore::BucketBuffered.

void casacore::BucketBase::extend ( uInt  nrBucket)

Extend the file with the given number of buckets.

The buckets get initialized when they are acquired (using getBucket) for the first time.

Bool casacore::BucketBase::flush ( )

Flush the cached buckets.

Possibly remaining uninitialized buckets will be initialized first. A True status is returned if buckets had to be written. The actual flushing is done using doFlush in the derived class.

virtual void casacore::BucketBase::initializeBuckets ( uInt  bucketNr)
protectedpure virtual

Initialize the bucket buffer.

The uninitialized buckets before this bucket are also initialized.

Implemented in casacore::BucketMapped, and casacore::BucketBuffered.

uInt casacore::BucketBase::nBucket ( ) const
inline

Get the current nr of buckets in the file.

Definition at line 86 of file BucketBase.h.

References itsCurNrOfBuckets.

BucketBase& casacore::BucketBase::operator= ( const BucketBase )
protected

Assignment is not possible.

virtual void casacore::BucketBase::resync ( uInt  nrBucket)
virtual

Resynchronize the object (after another process updated the file).

It remaps the file if the nr of buckets has changed. the new sizes.

void casacore::BucketBase::setWritten ( )
inline

Set that data has been written.

Definition at line 95 of file BucketBase.h.

References itsHasWritten, and casacore::True.

Member Data Documentation

uInt casacore::BucketBase::itsBucketSize
protected

The bucket size.

Definition at line 125 of file BucketBase.h.

uInt casacore::BucketBase::itsCurNrOfBuckets
protected

The current nr of buckets in the file.

Definition at line 127 of file BucketBase.h.

Referenced by nBucket().

BucketFile* casacore::BucketBase::itsFile
protected

The file used.

Definition at line 121 of file BucketBase.h.

Bool casacore::BucketBase::itsHasWritten
protected

Have data been written?

Definition at line 131 of file BucketBase.h.

Referenced by casacore::BucketMapped::getrwBucket(), and setWritten().

uInt casacore::BucketBase::itsNewNrOfBuckets
protected

The new nr of buckets in the file (after extension).

Definition at line 129 of file BucketBase.h.

Int64 casacore::BucketBase::itsStartOffset
protected

The starting offsets of the buckets in the file.

Definition at line 123 of file BucketBase.h.


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