Bds::DataFileBds Class Reference

This class implements the BDS Data File/Stream access system. More...

#include <BdsDataFileBds.h>

Inheritance diagram for Bds::DataFileBds:
Bds::DataFile

List of all members.

Public Types

enum  { StreamsMax = 256 }
enum  { DefaultBlockSize = 65536 }
enum  PackFormat { PackFormat_Unknown = 0, PackFormat_SM = 1, PackFormat_CM = 2, PackFormat_SM_CC = 3 }

Public Member Functions

 DataFileBds ()
 ~DataFileBds ()
BError open (BString fileName, BString mode)
 Open the file for reading or writing.
BError close ()
 Close file.
BError setFormat (BString format)
 Sets the sub-format.
BError setInfo (DataInfo &dataInfo, ChannelInfos &channelInfos, WriteOptionsList options=WriteOptionSensorData)
 Sets the information.
BError writeData (DataBlock &data)
 Writes a data block to the file.
DataOrder getDataOrder ()
 Get the expected order of writing data, by sample or by channel.
BError getInfo (DataInfo &dataInfo, ReadOptions options, BList< DataError > &errors)
 Get information on open file.
BError seekBlock (BUInt32 channel, BUInt segment, BTimeStamp time, BUInt32 &blockNumber, BUInt64 &sampleNumber, DataBlock &dataBlock)
 Find the block that contains the samples for the time requested.
BError readData (BUInt32 channel, BUInt segment, BUInt32 blockNumber, DataBlock &dataBlock)
 Read the data block for the given channel or all channels if blockNumber is 0.
BError setDiskBlockSize (BUInt32 blockSize)
 Sets up file/stream block size.
BUInt32 getDiskBlockSize ()
 Returns the data block size in bytes.

Static Public Member Functions

static DataFormat getFormats ()
 Get the names of the supported formats.

Private Member Functions

void clear ()
BError setInfoRepeat (BUInt32 repeat)
 Sets the reapeat period for the information packets.
BError infoSet (BUInt32 streamlet, BTimeStamp startTime, BTimeStamp endTime, BDictString &info)
 Sets the information packet and writes this to the file/stream.
BError infoGet (BdsDataPacket &packet, BDictString &info)
 Gets the information from an information packet.
BError addInfoPacket ()
BError addInfoExtraPacket ()
BError streamletFromChannel (BUInt channel, BUInt &streamlet)
 Find streamlet given channel.
BError dataAppend (DataBlock &data)
 Appends a data block to the file.
BError dataGet (BUInt channel, BdsDataPacket &packet, DataBlock &data)
 Gets the data from a data packet.
BError packetRead (BdsDataPacket &packet)
 Reads a packet from the file.
BError packetWrite (BdsDataPacket &packet)
 Writes a packet to the file.
void diskBlockReset ()
 Resets to disk block 0.
BError diskBlockWrite (void *data, BUInt32 numBytes, int header=0)
 Writes data to a block in the file.
BError diskBlockWriteFlush ()
 Flushes a semi-filled block to the file.
BError diskBlockRead (void *data, BUInt32 numBytes, int header=0)
 Reads data from a block.
BError diskBlockSeek (BUInt64 position)

Private Attributes

BString oformat
 The format.
PackFormat opackFormat
 The data packet format.
DataInfo odataInfo
 Information on the channel data.
ChannelInfos ochannelInfos
 Channel meta data information.
BUInt32 oinfoRepeat
 How often to output info packet.
BDictString oinfo
 Info packet output.
BdsDataPacketHeader oinfoHeader
 Info packet header.
BUInt32 odiskBlockSize
 The block size.
BdsDataBlockodiskBlock
 Data block buffer.
BUInt64 odiskPosition
 The disk block position.
BArray< BdsDataStreamletostreamlets
 Streamlet sequence numbers and positions.
BdsDataPacket opacket
 Temporary packet for header/data packet generation.
BArray< BdsDataSegmentosegments
 Data channel segments.
BArray< BArray< BdsDataBlockPos > > oblockPositions
 Data block positions for seeking.

Detailed Description

This class implements the BDS Data File/Stream access system.


Member Enumeration Documentation

anonymous enum
Enumerator:
StreamsMax 
anonymous enum
Enumerator:
DefaultBlockSize 
Enumerator:
PackFormat_Unknown 
PackFormat_SM 
PackFormat_CM 
PackFormat_SM_CC 

Constructor & Destructor Documentation

Bds::DataFileBds::DataFileBds (  ) 
Bds::DataFileBds::~DataFileBds (  ) 

Member Function Documentation

BError Bds::DataFileBds::addInfoExtraPacket (  )  [private]
BError Bds::DataFileBds::addInfoPacket (  )  [private]
void Bds::DataFileBds::clear (  )  [private]
BError Bds::DataFileBds::close (  )  [virtual]

Close file.

Reimplemented from Bds::DataFile.

BError Bds::DataFileBds::dataAppend ( DataBlock data  )  [private]

Appends a data block to the file.

BError Bds::DataFileBds::dataGet ( BUInt  channel,
BdsDataPacket packet,
DataBlock data 
) [private]

Gets the data from a data packet.

BError Bds::DataFileBds::diskBlockRead ( void *  data,
BUInt32  numBytes,
int  header = 0 
) [private]

Reads data from a block.

void Bds::DataFileBds::diskBlockReset (  )  [private]

Resets to disk block 0.

BError Bds::DataFileBds::diskBlockSeek ( BUInt64  position  )  [private]
BError Bds::DataFileBds::diskBlockWrite ( void *  data,
BUInt32  numBytes,
int  header = 0 
) [private]

Writes data to a block in the file.

BError Bds::DataFileBds::diskBlockWriteFlush (  )  [private]

Flushes a semi-filled block to the file.

DataFile::DataOrder Bds::DataFileBds::getDataOrder (  )  [virtual]

Get the expected order of writing data, by sample or by channel.

Reimplemented from Bds::DataFile.

uint32_t Bds::DataFileBds::getDiskBlockSize (  ) 

Returns the data block size in bytes.

DataFormat Bds::DataFileBds::getFormats (  )  [static]

Get the names of the supported formats.

Reimplemented from Bds::DataFile.

BError Bds::DataFileBds::getInfo ( DataInfo dataInfo,
ReadOptions  options,
BList< DataError > &  errors 
) [virtual]

Get information on open file.

Reimplemented from Bds::DataFile.

BError Bds::DataFileBds::infoGet ( BdsDataPacket packet,
BDictString &  info 
) [private]

Gets the information from an information packet.

BError Bds::DataFileBds::infoSet ( BUInt32  streamlet,
BTimeStamp  startTime,
BTimeStamp  endTime,
BDictString &  info 
) [private]

Sets the information packet and writes this to the file/stream.

BError Bds::DataFileBds::open ( BString  fileName,
BString  mode 
) [virtual]

Open the file for reading or writing.

Reimplemented from Bds::DataFile.

BError Bds::DataFileBds::packetRead ( BdsDataPacket packet  )  [private]

Reads a packet from the file.

BError Bds::DataFileBds::packetWrite ( BdsDataPacket packet  )  [private]

Writes a packet to the file.

BError Bds::DataFileBds::readData ( BUInt32  channel,
BUInt  segment,
BUInt32  blockNumber,
DataBlock dataBlock 
) [virtual]

Read the data block for the given channel or all channels if blockNumber is 0.

Reimplemented from Bds::DataFile.

BError Bds::DataFileBds::seekBlock ( BUInt32  channel,
BUInt  segment,
BTimeStamp  time,
BUInt32 &  blockNumber,
BUInt64 &  sampleNumber,
DataBlock dataBlock 
) [virtual]

Find the block that contains the samples for the time requested.

Reimplemented from Bds::DataFile.

BError Bds::DataFileBds::setDiskBlockSize ( BUInt32  blockSize  ) 

Sets up file/stream block size.

BError Bds::DataFileBds::setFormat ( BString  format  )  [virtual]

Sets the sub-format.

Reimplemented from Bds::DataFile.

BError Bds::DataFileBds::setInfo ( DataInfo dataInfo,
ChannelInfos channelInfos,
WriteOptionsList  options = WriteOptionSensorData 
) [virtual]

Sets the information.

Reimplemented from Bds::DataFile.

BError Bds::DataFileBds::setInfoRepeat ( BUInt32  repeat  )  [private]

Sets the reapeat period for the information packets.

BError Bds::DataFileBds::streamletFromChannel ( BUInt  channel,
BUInt &  streamlet 
) [private]

Find streamlet given channel.

BError Bds::DataFileBds::writeData ( DataBlock data  )  [virtual]

Writes a data block to the file.

Reimplemented from Bds::DataFile.


Member Data Documentation

Data block positions for seeking.

Channel meta data information.

Information on the channel data.

Data block buffer.

The block size.

The disk block position.

BString Bds::DataFileBds::oformat [private]

The format.

Reimplemented from Bds::DataFile.

BDictString Bds::DataFileBds::oinfo [private]

Info packet output.

Info packet header.

BUInt32 Bds::DataFileBds::oinfoRepeat [private]

How often to output info packet.

Temporary packet for header/data packet generation.

The data packet format.

Data channel segments.

Streamlet sequence numbers and positions.


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

Generated on 3 Oct 2012 for BdsApi by  doxygen 1.6.1