casa
5.7.0-16
|
File object for Tiled Storage Manager. More...
#include <TSMFile.h>
Public Member Functions | |
TSMFile (const TiledStMan *stMan, uInt fileSequenceNr, const TSMOption &, MultiFileBase *mfile=0) | |
Create a TSMFile object (with corresponding file). More... | |
TSMFile (const String &fileName, Bool writable, const TSMOption &, MultiFileBase *mfile=0) | |
Create a TSMFile object for the given existing file. More... | |
TSMFile (const TiledStMan *stMan, AipsIO &ios, uInt seqnr, const TSMOption &, MultiFileBase *mfile=0) | |
Read the object back. More... | |
~TSMFile () | |
The destructor closes the file. More... | |
void | putObject (AipsIO &ios) const |
Write the object. More... | |
void | getObject (AipsIO &ios) |
Get the object. More... | |
void | open () |
Open the file if not open yet. More... | |
BucketFile * | bucketFile () |
Return the BucketFile object (to be used in the BucketCache). More... | |
Int64 | length () const |
Return the logical file length. More... | |
uInt | sequenceNumber () const |
Return the file sequence number. More... | |
void | extend (Int64 increment) |
Increment the logical file length. More... | |
Private Member Functions | |
TSMFile (const TSMFile &) | |
Forbid copy constructor. More... | |
TSMFile & | operator= (const TSMFile &) |
Forbid assignment. More... | |
Private Attributes | |
uInt | fileSeqnr_p |
The file sequence number. More... | |
BucketFile * | file_p |
The file object. More... | |
Int64 | length_p |
The (logical) length of the file. More... | |
File object for Tiled Storage Manager.
Internal
TSMFile represents a data file for the Tiled Storage Manager.
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.
Encapsulate the Tiled Storage Manager file details.
casacore::TSMFile::TSMFile | ( | const TiledStMan * | stMan, |
uInt | fileSequenceNr, | ||
const TSMOption & | , | ||
MultiFileBase * | mfile = 0 |
||
) |
Create a TSMFile object (with corresponding file).
The sequence number gets part of the file name.
casacore::TSMFile::TSMFile | ( | const String & | fileName, |
Bool | writable, | ||
const TSMOption & | , | ||
MultiFileBase * | mfile = 0 |
||
) |
Create a TSMFile object for the given existing file.
casacore::TSMFile::TSMFile | ( | const TiledStMan * | stMan, |
AipsIO & | ios, | ||
uInt | seqnr, | ||
const TSMOption & | , | ||
MultiFileBase * | mfile = 0 |
||
) |
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.
casacore::TSMFile::~TSMFile | ( | ) |
The destructor closes the file.
|
private |
Forbid copy constructor.
|
inline |
Return the BucketFile object (to be used in the BucketCache).
Definition at line 151 of file TSMFile.h.
References file_p.
|
inline |
void casacore::TSMFile::getObject | ( | AipsIO & | ios | ) |
Get the object.
|
inline |
|
inline |
Open the file if not open yet.
Definition at line 154 of file TSMFile.h.
References file_p, and casacore::BucketFile::open().
void casacore::TSMFile::putObject | ( | AipsIO & | ios | ) | const |
Write the object.
|
inline |
|
private |
|
private |
|
private |