26#ifndef CASA_BUCKETFILE_H
27#define CASA_BUCKETFILE_H
30#include <casacore/casa/aips.h>
31#include <casacore/casa/IO/ByteIO.h>
32#include <casacore/casa/IO/MMapfdIO.h>
33#include <casacore/casa/IO/FilebufIO.h>
34#include <casacore/casa/BasicSL/String.h>
115 const std::shared_ptr<MultiFileBase>& mfile=std::shared_ptr<MultiFileBase>());
125 const std::shared_ptr<MultiFileBase>& mfile=std::shared_ptr<MultiFileBase>());
virtual Int64 fileSize() const
Get the (physical) size of the file.
Bool isWritable() const
Has the file logically been indicated as writable?
std::shared_ptr< MultiFileBase > mfile_p
The possibly used MultiFileBase.
virtual uInt write(const void *buffer, uInt length)
Write bytes into the file.
std::shared_ptr< ByteIO > file_p
The unbuffered file.
virtual void open()
Open the file if not open yet.
virtual void close()
Close the file (if open).
BucketFile & operator=(const BucketFile &)=delete
Forbid assignment.
BucketFile(const String &fileName, uInt bufSizeFile=0, Bool mappedFile=False, const std::shared_ptr< MultiFileBase > &mfile=std::shared_ptr< MultiFileBase >())
Create a BucketFile object for a new file.
virtual void setRW()
Set the file to read/write access.
void createMapBuf()
Create the mapped or buffered file object.
virtual uInt read(void *buffer, uInt length)
Read bytes from the file.
MMapfdIO * mappedFile()
Get the mapped file object.
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.
FilebufIO * bufferedFile()
Get the buffered file object.
virtual std::shared_ptr< ByteIO > makeFilebufIO(uInt bufferSize)
Make a (temporary) buffered IO object for this file.
BucketFile(const BucketFile &)=delete
Forbid copy constructor.
virtual void fsync()
Fsync the file (i.e.
String name_p
The file name.
virtual const String & name() const
Get the file name.
BucketFile(const String &fileName, Bool writable, uInt bufSizeFile=0, Bool mappedFile=False, const std::shared_ptr< MultiFileBase > &mfile=std::shared_ptr< MultiFileBase >())
Create a BucketFile object for an existing file.
FilebufIO * bufferedFile_p
The optional buffered file.
void deleteMapBuf()
Delete the possible mapped or buffered file object.
virtual void seek(Int64 offset)
Seek in the file.
virtual void remove()
Remove the file (and close it if needed).
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.