28 #ifndef CASA_BUCKETFILE_H
29 #define CASA_BUCKETFILE_H
32 #include <casacore/casa/aips.h>
33 #include <casacore/casa/IO/ByteIO.h>
34 #include <casacore/casa/IO/MMapfdIO.h>
35 #include <casacore/casa/IO/FilebufIO.h>
36 #include <casacore/casa/BasicSL/String.h>
37 #include <casacore/casa/Utilities/CountedPtr.h>
virtual Int64 fileSize() const
Get the (physical) size of the file.
Bool isWritable() const
Has the file logically been indicated as writable?
virtual uInt write(const void *buffer, uInt length)
Write bytes into the file.
virtual void open()
Open the file if not open yet.
virtual void close()
Close the file (if open).
BucketFile(const String &fileName, uInt bufSizeFile=0, Bool mappedFile=False, MultiFileBase *mfile=0)
Create a BucketFile object for a new file.
BucketFile(const String &fileName, Bool writable, uInt bufSizeFile=0, Bool mappedFile=False, MultiFileBase *mfile=0)
Create a BucketFile object for an existing file.
MMapfdIO * mappedFile()
Get the mapped file object.
virtual void setRW()
Set the file to read/write access.
CountedPtr< ByteIO > file_p
The unbuffered file.
void createMapBuf()
Create the mapped or buffered file object.
virtual uInt read(void *buffer, uInt length)
Read bytes from the file.
virtual CountedPtr< ByteIO > makeFilebufIO(uInt bufferSize)
Make a (temporary) buffered IO object for this file.
MMapfdIO * mappedFile_p
The optional mapped file.
virtual ~BucketFile()
The destructor closes the file (if open).
Bool isCached() const
Is the file cached, mapped, or buffered?
Bool isWritable_p
The (logical) writability of the file.
MultiFileBase * mfile_p
The possibly used MultiFileBase.
virtual void fsync()
Fsync the file (i.e.
String name_p
The file name.
virtual const String & name() const
Get the file name.
FilebufIO * bufferedFile_p
The optional buffered file.
void deleteMapBuf()
Delete the possible mapped or buffered file object.
FilebufIO * bufferedFile()
Get the buffered file object.
BucketFile & operator=(const BucketFile &)
Forbid assignment.
virtual void seek(Int64 offset)
Seek in the file.
BucketFile(const BucketFile &)
Forbid copy constructor.
virtual void remove()
Remove the file (and close it if needed).
Referenced counted pointer for constant data.
Abstract base class to combine multiple files in a single one.
String: the storage and methods of handling collections of characters.
this file contains all the compiler specific defines
long long Int64
Define the extra non-standard types used by Casacore (like proposed uSize, Size)
LatticeExprNode length(const LatticeExprNode &expr, const LatticeExprNode &axis)
2-argument function to get the length of an axis.
bool Bool
Define the standard types used by Casacore.