BdsApi
2.0.11
|
This class defines the interface for generic data file access. More...
#include <BdsDataFile.h>
Public Types | |
enum | DataOrder { DataOrderUnknown, DataOrderAll, DataOrderSample, DataOrderChannel } |
enum | Features { FeatureNone = 0x00, FeatureCanWrite = 0x01, FeatureCanRead = 0x02 } |
enum | WriteOptionsList { WriteOptionNone = 0x00, WriteOptionSensorData = 0x01, WriteOptionNoMetadata = 0x02 } |
enum | ReadOptionsList { ReadOptionNone = 0x00, ReadOptionValidate = 0x01, ReadOptionFileNameProcess = 0x02, ReadOptionValidateCorruptions = 0x04, ReadOptionReorder = 0x08, ReadOptionDeleteDuplicates = 0x10, ReadOptionInfoExtra = 0x20, ReadOptionIgnoreSamplerate = 0x40, ReadOptionPrintBlocks = 0x80 } |
Public Member Functions | |
DataFile () | |
virtual | ~DataFile () |
virtual void | init () |
Initialise. More... | |
virtual BError | open (BString fileName, BString mode) |
Open the file for read or write. More... | |
virtual BError | close () |
Close the file. More... | |
virtual BError | setFormat (BString format) |
Set the sub-format. More... | |
virtual BString | getFileName () |
Return the file name. More... | |
virtual DataOrder | getDataOrder () |
Get the expected order of writing data, by sample or by channel. More... | |
virtual int | getFeatures () |
Get bitmask of supported features. More... | |
virtual BError | setInfo (const DataInfo &dataInfo, const ChannelInfos &channelInfos, WriteOptionsList options=WriteOptionNone) |
Set information on data for write. More... | |
virtual BError | start (BUInt channel, BUInt segment) |
Start next segment of data. More... | |
virtual BError | writeData (const DataBlock &data) |
Write a block of data. More... | |
virtual BError | end () |
End segment. More... | |
virtual BError | flush () |
Flush data to disk. More... | |
virtual BError | fileNameProcess () |
Parse the file name for a date/time. More... | |
virtual BError | getFormat (BString &format) |
Get sub-format. More... | |
virtual BError | getInfo (DataInfo &dataInfo, DataFileOptions options, BList< DataError > &errors) |
Get info on data. More... | |
virtual BError | seekBlock (BUInt32 channel, BUInt segment, BTimeStamp time, BUInt32 &blockNumber, BUInt64 &sampleNumber, DataBlock &data) |
Find requested block on given channel given a time. More... | |
virtual BError | readData (BUInt32 channel, BUInt segment, BUInt32 blockNumber, DataBlock &dataBlock) |
Read a block. More... | |
virtual BError | getMetaData (ChannelInfos &channelInfos) |
Return all known MetaData in the file. More... | |
void | dataErrorFixup (DataInfo &dataInfo, BList< DataError > &errors) |
Fixup data errors, mainly start/end times to be within data. More... | |
BInt64 | timeCompare (BTimeStamp t1, BTimeStamp t2, BUInt diff) |
Compare timestamps with a margin. More... | |
int | duplicateCheck (DataBlock &data1, DataBlock &data2, BUInt channel=0) |
Check if blocks are duplicates. More... | |
BUInt64 | getFilePosition () |
Static Public Member Functions | |
static DataFormat | getFormats () |
Get list of supported formats. More... | |
Protected Attributes | |
BString | ofileName |
BString | omode |
BTimeStamp | ofileNameTime |
BFile | ofile |
BString | oformat |
This class defines the interface for generic data file access.
Bds::DataFile::DataFile | ( | ) |
|
virtual |
|
virtual |
Close the file.
Reimplemented in Bds::DataFileBds, Bds::DataFileBds, and Bds::DataFileIms.
Fixup data errors, mainly start/end times to be within data.
Check if blocks are duplicates.
|
virtual |
End segment.
Reimplemented in Bds::DataFileLog, Bds::DataFileAscii, and Bds::DataFileIms.
|
virtual |
Parse the file name for a date/time.
|
virtual |
Flush data to disk.
Reimplemented in Bds::DataFileBds.
|
virtual |
Get the expected order of writing data, by sample or by channel.
Reimplemented in Bds::DataFileBds, Bds::DataFileBds, Bds::DataFileCd, Bds::DataFileCss, Bds::DataFileGcf, Bds::DataFileIms, Bds::DataFileAscii, Bds::DataFileLog, Bds::DataFileWra, Bds::DataFileAd22, Bds::DataFileBdrs, Bds::DataFileLac, and Bds::DataFileWraAgso.
|
virtual |
Get bitmask of supported features.
Reimplemented in Bds::DataFileCd, Bds::DataFileCss, Bds::DataFileGcf, Bds::DataFileIms, Bds::DataFileAscii, Bds::DataFileLog, Bds::DataFileResponse, Bds::DataFileSac, Bds::DataFileWra, Bds::DataFileAd22, Bds::DataFileBdrs, Bds::DataFileLac, and Bds::DataFileWraAgso.
|
virtual |
Return the file name.
BUInt64 Bds::DataFile::getFilePosition | ( | ) |
|
virtual |
Get sub-format.
|
static |
Get list of supported formats.
|
virtual |
Get info on data.
Reimplemented in Bds::DataFileBds, Bds::DataFileBds, Bds::DataFileCd, Bds::DataFileCss, Bds::DataFileGcf, Bds::DataFileTapeDigitiser, Bds::DataFileLog, Bds::DataFileWra, Bds::DataFileAd22, Bds::DataFileBdrs, Bds::DataFileLac, and Bds::DataFileWraAgso.
|
virtual |
Return all known MetaData in the file.
Reimplemented in Bds::DataFileIms, and Bds::DataFileResponse.
|
virtual |
Initialise.
|
virtual |
Open the file for read or write.
Reimplemented in Bds::DataFileBds, Bds::DataFileBds, Bds::DataFileTapeDigitiser, Bds::DataFileAscii, Bds::DataFileBknas, Bds::DataFileIms, and Bds::DataFileLog.
|
virtual |
Read a block.
Reimplemented in Bds::DataFileBds, Bds::DataFileBds, Bds::DataFileCd, Bds::DataFileCss, Bds::DataFileGcf, Bds::DataFileTapeDigitiser, Bds::DataFileLog, Bds::DataFileWra, Bds::DataFileAd22, Bds::DataFileBdrs, Bds::DataFileLac, and Bds::DataFileWraAgso.
|
virtual |
Find requested block on given channel given a time.
Reimplemented in Bds::DataFileBds, and Bds::DataFileBds.
|
virtual |
Set the sub-format.
Reimplemented in Bds::DataFileBds, Bds::DataFileBds, Bds::DataFileLog, Bds::DataFileAscii, and Bds::DataFileWra.
|
virtual |
Set information on data for write.
Reimplemented in Bds::DataFileBds, Bds::DataFileBds, Bds::DataFileLog, Bds::DataFileResponse, Bds::DataFileAscii, Bds::DataFileIms, Bds::DataFileBknas, and Bds::DataFileSac.
|
virtual |
Start next segment of data.
Reimplemented in Bds::DataFileLog, Bds::DataFileAscii, and Bds::DataFileIms.
BInt64 Bds::DataFile::timeCompare | ( | BTimeStamp | t1, |
BTimeStamp | t2, | ||
BUInt | diff | ||
) |
Compare timestamps with a margin.
|
virtual |
Write a block of data.
Reimplemented in Bds::DataFileBds, Bds::DataFileBds, Bds::DataFileLog, Bds::DataFileAscii, Bds::DataFileIms, and Bds::DataFileBknas.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |