casacore
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members

More...

#include <TSMFile.h>

Public Member Functions

 TSMFile (const TiledStMan *stMan, uInt fileSequenceNr, const TSMOption &, const std::shared_ptr< MultiFileBase > &=std::shared_ptr< MultiFileBase >())
 Create a TSMFile object (with corresponding file).
 
 TSMFile (const String &fileName, Bool writable, const TSMOption &, const std::shared_ptr< MultiFileBase > &=std::shared_ptr< MultiFileBase >())
 Create a TSMFile object for the given existing file.
 
 TSMFile (const TiledStMan *stMan, AipsIO &ios, uInt seqnr, const TSMOption &, const std::shared_ptr< MultiFileBase > &=std::shared_ptr< MultiFileBase >())
 Read the object back.
 
 ~TSMFile ()
 The destructor closes the file.
 
 TSMFile (const TSMFile &)=delete
 Forbid copy constructor.
 
TSMFileoperator= (const TSMFile &)=delete
 Forbid assignment.
 
void putObject (AipsIO &ios) const
 Write the object.
 
void getObject (AipsIO &ios)
 Get the object.
 
void open ()
 Open the file if not open yet.
 
BucketFilebucketFile ()
 Return the BucketFile object (to be used in the BucketCache).
 
Int64 length () const
 Return the logical file length.
 
uInt sequenceNumber () const
 Return the file sequence number.
 
void extend (Int64 increment)
 Increment the logical file length.
 

Private Attributes

uInt fileSeqnr_p
 The file sequence number.
 
BucketFilefile_p
 The file object.
 
Int64 length_p
 The (logical) length of the file.
 

Detailed Description

File object for Tiled Storage Manager.

Intended use:

Internal

Review Status

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

Prerequisite

Etymology

TSMFile represents a data file for the Tiled Storage Manager.

Synopsis

A TSMFile object represents a data file. Currently it is meant for the TiledStMan classes, but it can easily be turned into a more general storage manager file class.
Creation of a TSMFile object does not open the file. An explicit open call has to be given before the file can be used.

Underneath it uses a BucketFile to access the file. In this way the IO details are well encapsulated.

Motivation

Encapsulate the Tiled Storage Manager file details.

Definition at line 79 of file TSMFile.h.

Constructor & Destructor Documentation

◆ TSMFile() [1/4]

casacore::TSMFile::TSMFile ( const TiledStMan stMan,
uInt  fileSequenceNr,
const TSMOption ,
const std::shared_ptr< MultiFileBase > &  = std::shared_ptr< MultiFileBase >() 
)

Create a TSMFile object (with corresponding file).

The sequence number gets part of the file name.

◆ TSMFile() [2/4]

casacore::TSMFile::TSMFile ( const String fileName,
Bool  writable,
const TSMOption ,
const std::shared_ptr< MultiFileBase > &  = std::shared_ptr< MultiFileBase >() 
)

Create a TSMFile object for the given existing file.

◆ TSMFile() [3/4]

casacore::TSMFile::TSMFile ( const TiledStMan stMan,
AipsIO ios,
uInt  seqnr,
const TSMOption ,
const std::shared_ptr< MultiFileBase > &  = std::shared_ptr< MultiFileBase >() 
)

Read the object back.

The file is not opened until the first access, thus until the file descriptor is asked for the first time. It checks if the sequence number matches the expected one.

◆ ~TSMFile()

casacore::TSMFile::~TSMFile ( )

The destructor closes the file.

◆ TSMFile() [4/4]

casacore::TSMFile::TSMFile ( const TSMFile )
delete

Forbid copy constructor.

Member Function Documentation

◆ bucketFile()

BucketFile * casacore::TSMFile::bucketFile ( )
inline

Return the BucketFile object (to be used in the BucketCache).

Definition at line 150 of file TSMFile.h.

References file_p.

◆ extend()

void casacore::TSMFile::extend ( Int64  increment)
inline

Increment the logical file length.

Definition at line 147 of file TSMFile.h.

References length_p.

◆ getObject()

void casacore::TSMFile::getObject ( AipsIO ios)

Get the object.

◆ length()

Int64 casacore::TSMFile::length ( ) const
inline

Return the logical file length.

Definition at line 141 of file TSMFile.h.

References length_p.

◆ open()

void casacore::TSMFile::open ( )
inline

Open the file if not open yet.

Definition at line 153 of file TSMFile.h.

References file_p, and casacore::BucketFile::open().

◆ operator=()

TSMFile & casacore::TSMFile::operator= ( const TSMFile )
delete

Forbid assignment.

◆ putObject()

void casacore::TSMFile::putObject ( AipsIO ios) const

Write the object.

◆ sequenceNumber()

uInt casacore::TSMFile::sequenceNumber ( ) const
inline

Return the file sequence number.

Definition at line 144 of file TSMFile.h.

References fileSeqnr_p.

Member Data Documentation

◆ file_p

BucketFile* casacore::TSMFile::file_p
private

The file object.

Definition at line 135 of file TSMFile.h.

Referenced by bucketFile(), and open().

◆ fileSeqnr_p

uInt casacore::TSMFile::fileSeqnr_p
private

The file sequence number.

Definition at line 133 of file TSMFile.h.

Referenced by sequenceNumber().

◆ length_p

Int64 casacore::TSMFile::length_p
private

The (logical) length of the file.

Definition at line 137 of file TSMFile.h.

Referenced by extend(), and length().


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