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