28 #ifndef CASA_MULTIFILEBASE_H 29 #define CASA_MULTIFILEBASE_H 32 #include <casacore/casa/aips.h> 33 #include <casacore/casa/IO/ByteIO.h> 34 #include <casacore/casa/BasicSL/String.h> 35 #include <casacore/casa/Utilities/CountedPtr.h> 36 #include <casacore/casa/vector.h> 37 #include <casacore/casa/ostream.h> 82 { buffer = std::shared_ptr<MultiFileBuffer> (
new MultiFileBuffer(bufSize, useODirect)); }
89 std::shared_ptr<MultiFileBuffer>
buffer;
189 void deleteFile (
Int fileId);
208 virtual void reopenRW() = 0;
211 virtual void fsync() = 0;
219 {
return itsWritable; }
223 {
return itsUseODirect; }
227 {
return itsBlockSize; }
234 {
return itsNrBlock; }
237 const vector<MultiFileInfo>&
info()
const 242 {
return itsFreeBlocks; }
256 virtual void flushFile() = 0;
258 virtual void close() = 0;
260 virtual void writeHeader() = 0;
263 virtual void readHeader (
Bool always=
True) = 0;
268 const void* buffer) = 0;
long long Int64
Define the extra non-standard types used by Casacore (like proposed uSize, Size)
Abstract base class to combine multiple files in a single one.
AipsIO is the object persistency mechanism of Casacore.
CountedPtr< HDF5DataSet > dataSet
Helper class for MultiFileBase containing info per internal file.
ostream & operator<<(ostream &os, const IComplex &)
Show on ostream.
String fileName() const
Get the file name of the MultiFileBase.
std::shared_ptr< MultiFileBuffer > buffer
const vector< Int64 > & freeBlocks() const
Get the free blocks (for test purposes mainly).
Referenced counted pointer for constant data.
Bool useODirect() const
Will O_DIRECT be used?
Helper class for MultiFileInfo holding a data buffer.
bool Bool
Define the standard types used by Casacore.
MultiFileBuffer(size_t bufSize, Bool useODirect)
CountedPtr< HDF5Group > group
void allocBuffer(Int64 bufSize, Bool useODirect=False)
Allocate the buffer.
Int64 blockSize() const
Get the block size used.
const vector< MultiFileInfo > & info() const
Get the info object (for test purposes mainly).
String: the storage and methods of handling collections of characters.
vector< Int64 > itsFreeBlocks
AipsIO & operator>>(AipsIO &os, Record &rec)
vector< MultiFileInfo > itsInfo
std::shared_ptr< MultiFileBuffer > itsBuffer
void writeDirty(MultiFileInfo &info)
Bool isWritable() const
Is the file writable?
MultiFileBuffer & operator=(const MultiFileBuffer &)
this file contains all the compiler specific defines
Int64 size() const
Get the total nr of data blocks used.