BdsApi  2.0.11
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
Bds::DataFileTapeDigitiser Class Reference

This class implements the TapeDigitiser's file output conversion and storeing system. More...

#include <BdsDataFileTapeDigitiser.h>

Inheritance diagram for Bds::DataFileTapeDigitiser:
Bds::DataFile

Public Member Functions

 DataFileTapeDigitiser ()
 
BError open (BString fileName, BString mode)
 Open the file for reading or writing. More...
 
BError getInfo (DataInfo &dataInfo, DataFileOptions options, BList< DataError > &errors)
 Get info on data. More...
 
BError readData (BUInt32 channel, BUInt segment, BUInt32 blockNumber, DataBlock &data)
 Read a block. More...
 
- Public Member Functions inherited from Bds::DataFile
 DataFile ()
 
virtual ~DataFile ()
 
virtual void init ()
 Initialise. 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 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 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 ()
 
- Static Public Member Functions inherited from Bds::DataFile
static DataFormat getFormats ()
 Get list of supported formats. More...
 

Private Member Functions

uint32_t blockSize ()
 Returns the data block size in bytes. More...
 
uint32_t blockNumSamples ()
 Returns the number of samples of data in a block. More...
 
BError readHeader (BDictString &header)
 Read the file header info. More...
 
uint32_t computeChecksum (void *data, int nBytes)
 

Private Attributes

BDictString oheader
 
off64_t oheaderSize
 
uint32_t oblockSize
 
uint32_t oblockNumSamples
 
double osampleRate
 
BBuffer obuffer
 Data block buffer. More...
 
BString oversion
 
DataInfo odataInfo
 

Additional Inherited Members

- Public Types inherited from Bds::DataFile
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
}
 
- Protected Attributes inherited from Bds::DataFile
BString ofileName
 
BString omode
 
BTimeStamp ofileNameTime
 
BFile ofile
 
BString oformat
 

Detailed Description

This class implements the TapeDigitiser's file output conversion and storeing system.

Constructor & Destructor Documentation

◆ DataFileTapeDigitiser()

Bds::DataFileTapeDigitiser::DataFileTapeDigitiser ( )

Member Function Documentation

◆ blockNumSamples()

uint32_t Bds::DataFileTapeDigitiser::blockNumSamples ( )
private

Returns the number of samples of data in a block.

◆ blockSize()

uint32_t Bds::DataFileTapeDigitiser::blockSize ( )
private

Returns the data block size in bytes.

◆ computeChecksum()

uint32_t Bds::DataFileTapeDigitiser::computeChecksum ( void *  data,
int  nBytes 
)
private

◆ getFormats()

DataFormat Bds::DataFileTapeDigitiser::getFormats ( )
static

◆ getInfo()

BError Bds::DataFileTapeDigitiser::getInfo ( DataInfo dataInfo,
DataFileOptions  options,
BList< DataError > &  errors 
)
virtual

Get info on data.

Reimplemented from Bds::DataFile.

◆ open()

BError Bds::DataFileTapeDigitiser::open ( BString  fileName,
BString  mode 
)
virtual

Open the file for reading or writing.

Reimplemented from Bds::DataFile.

◆ readData()

BError Bds::DataFileTapeDigitiser::readData ( BUInt32  channel,
BUInt  segment,
BUInt32  blockNumber,
DataBlock dataBlock 
)
virtual

Read a block.

Reimplemented from Bds::DataFile.

◆ readHeader()

BError Bds::DataFileTapeDigitiser::readHeader ( BDictString &  header)
private

Read the file header info.

Member Data Documentation

◆ oblockNumSamples

uint32_t Bds::DataFileTapeDigitiser::oblockNumSamples
private

◆ oblockSize

uint32_t Bds::DataFileTapeDigitiser::oblockSize
private

◆ obuffer

BBuffer Bds::DataFileTapeDigitiser::obuffer
private

Data block buffer.

◆ odataInfo

DataInfo Bds::DataFileTapeDigitiser::odataInfo
private

◆ oheader

BDictString Bds::DataFileTapeDigitiser::oheader
private

◆ oheaderSize

off64_t Bds::DataFileTapeDigitiser::oheaderSize
private

◆ osampleRate

double Bds::DataFileTapeDigitiser::osampleRate
private

◆ oversion

BString Bds::DataFileTapeDigitiser::oversion
private

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