BdsApi  2.2.6
This is the Blacknest BDS API.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
Bds::DataFile Class Reference

This class defines the interface for generic data file access that all of the BDS data conterors share. More...

#include <BdsDataFile.h>

Inheritance diagram for Bds::DataFile:
Bds::DataFileAd22 Bds::DataFileAscii Bds::DataFileBdrs Bds::DataFileBds Bds::DataFileBknas Bds::DataFileCd Bds::DataFileCss Bds::DataFileGcf Bds::DataFileIms Bds::DataFileLac Bds::DataFileLog Bds::DataFileResponse Bds::DataFileSac Bds::DataFileSeed Bds::DataFileStationXml Bds::DataFileTapeDigitiser Bds::DataFileWra Bds::DataFileWraAgso

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 writing next segment of data. More...
 
virtual BError writeData (const DataBlock &data)
 Write a block of data. More...
 
virtual BError end ()
 End write 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, BUInt32 options, BList< DataError > &errors)
 Return all known MetaData in the file. More...
 
void dataErrorFixup (const 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 (const DataBlock &data1, const 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
 

Detailed Description

This class defines the interface for generic data file access that all of the BDS data conterors share.

Member Enumeration Documentation

Enumerator
DataOrderUnknown 
DataOrderAll 
DataOrderSample 
DataOrderChannel 
Enumerator
FeatureNone 
FeatureCanWrite 
FeatureCanRead 
Enumerator
ReadOptionNone 
ReadOptionValidate 
ReadOptionFileNameProcess 
ReadOptionValidateCorruptions 
ReadOptionReorder 
ReadOptionDeleteDuplicates 
ReadOptionInfoExtra 
ReadOptionIgnoreSamplerate 
ReadOptionPrintBlocks 
Enumerator
WriteOptionNone 
WriteOptionSensorData 
WriteOptionNoMetadata 

Constructor & Destructor Documentation

Bds::DataFile::DataFile ( )
Bds::DataFile::~DataFile ( )
virtual

Member Function Documentation

BError Bds::DataFile::close ( )
virtual

Close the file.

Reimplemented in Bds::DataFileBds, Bds::DataFileSeed, and Bds::DataFileIms.

void Bds::DataFile::dataErrorFixup ( const DataInfo dataInfo,
BList< DataError > &  errors 
)

Fixup data errors, mainly start/end times to be within data.

int Bds::DataFile::duplicateCheck ( const DataBlock data1,
const DataBlock data2,
BUInt  channel = 0 
)

Check if blocks are duplicates.

BError Bds::DataFile::end ( )
virtual

End write segment.

Reimplemented in Bds::DataFileSeed, Bds::DataFileLog, Bds::DataFileAscii, and Bds::DataFileIms.

BError Bds::DataFile::fileNameProcess ( )
virtual

Parse the file name for a date/time.

BError Bds::DataFile::flush ( )
virtual

Flush data to disk.

Reimplemented in Bds::DataFileBds.

DataFile::DataOrder Bds::DataFile::getDataOrder ( )
virtual
int Bds::DataFile::getFeatures ( )
virtual
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.

BError Bds::DataFile::getInfo ( DataInfo dataInfo,
DataFileOptions  options,
BList< DataError > &  errors 
)
virtual
BError Bds::DataFile::getMetaData ( ChannelInfos channelInfos,
BUInt32  options,
BList< DataError > &  errors 
)
virtual

Return all known MetaData in the file.

Reimplemented in Bds::DataFileSeed, Bds::DataFileIms, Bds::DataFileStationXml, and Bds::DataFileResponse.

void Bds::DataFile::init ( )
virtual

Initialise.

BError Bds::DataFile::open ( BString  fileName,
BString  mode 
)
virtual
BError Bds::DataFile::readData ( BUInt32  channel,
BUInt  segment,
BUInt32  blockNumber,
DataBlock dataBlock 
)
virtual
BError Bds::DataFile::seekBlock ( BUInt32  channel,
BUInt  segment,
BTimeStamp  time,
BUInt32 blockNumber,
BUInt64 sampleNumber,
DataBlock data 
)
virtual

Find requested block on given channel given a time.

Reimplemented in Bds::DataFileBds.

BError Bds::DataFile::setFormat ( BString  format)
virtual
BError Bds::DataFile::setInfo ( const DataInfo dataInfo,
const ChannelInfos channelInfos,
WriteOptionsList  options = WriteOptionNone 
)
virtual
BError Bds::DataFile::start ( BUInt  channel,
BUInt  segment 
)
virtual

Start writing next segment of data.

Reimplemented in Bds::DataFileSeed, Bds::DataFileLog, Bds::DataFileAscii, and Bds::DataFileIms.

BInt64 Bds::DataFile::timeCompare ( BTimeStamp  t1,
BTimeStamp  t2,
BUInt  diff 
)

Compare timestamps with a margin.

BError Bds::DataFile::writeData ( const DataBlock data)
virtual

Member Data Documentation

BFile Bds::DataFile::ofile
protected
BString Bds::DataFile::ofileName
protected
BTimeStamp Bds::DataFile::ofileNameTime
protected
BString Bds::DataFile::oformat
protected
BString Bds::DataFile::omode
protected

The documentation for this class was generated from the following files: