#include <BdsDataFileBds.h>
Inheritance diagram for Bds::DataFileBds:
Public Types | |
StreamsMax = 256 | |
DefaultBlockSize = 65536 | |
PackFormat_Unknown = 0 | |
PackFormat_SM = 1 | |
PackFormat_CM = 2 | |
PackFormat_SM_CC = 3 | |
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) |
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, Options options, BList< BError > &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. | |
BdsDataBlock * | odiskBlock |
Data block buffer. | |
BUInt64 | odiskPosition |
The disk block position. | |
BArray< BdsDataStreamlet > | ostreamlets |
Streamlet sequence numbers and positions. | |
BdsDataPacket | opacket |
Temporary packet for header/data packet generation. | |
BArray< BdsDataSegment > | osegments |
Data channel segments. | |
BArray< BArray< BdsDataBlockPos > > | oblockPositions |
Data block positions for seeking. |
Bds::DataFileBds::DataFileBds | ( | ) |
Bds::DataFileBds::~DataFileBds | ( | ) |
BError Bds::DataFileBds::addInfoExtraPacket | ( | ) | [private] |
BError Bds::DataFileBds::addInfoPacket | ( | ) | [private] |
void Bds::DataFileBds::clear | ( | ) | [private] |
BError Bds::DataFileBds::close | ( | ) | [virtual] |
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] |
uint32_t Bds::DataFileBds::getDiskBlockSize | ( | ) |
Returns the data block size in bytes.
DataFormat Bds::DataFileBds::getFormats | ( | ) | [static] |
Get information on open file.
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] |
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] |
BError Bds::DataFileBds::setDiskBlockSize | ( | BUInt32 | blockSize | ) |
Sets up file/stream block size.
BError Bds::DataFileBds::setFormat | ( | BString | format | ) | [virtual] |
BError Bds::DataFileBds::setInfo | ( | DataInfo & | dataInfo, | |
ChannelInfos & | channelInfos | |||
) | [virtual] |
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] |
BArray<BArray<BdsDataBlockPos> > Bds::DataFileBds::oblockPositions [private] |
Data block positions for seeking.
ChannelInfos Bds::DataFileBds::ochannelInfos [private] |
Channel meta data information.
DataInfo Bds::DataFileBds::odataInfo [private] |
Information on the channel data.
BdsDataBlock* Bds::DataFileBds::odiskBlock [private] |
Data block buffer.
BUInt32 Bds::DataFileBds::odiskBlockSize [private] |
The block size.
BUInt64 Bds::DataFileBds::odiskPosition [private] |
The disk block position.
BString Bds::DataFileBds::oformat [private] |
BDictString Bds::DataFileBds::oinfo [private] |
Info packet output.
Info packet header.
BUInt32 Bds::DataFileBds::oinfoRepeat [private] |
How often to output info packet.
BdsDataPacket Bds::DataFileBds::opacket [private] |
Temporary packet for header/data packet generation.
PackFormat Bds::DataFileBds::opackFormat [private] |
The data packet format.
BArray<BdsDataSegment> Bds::DataFileBds::osegments [private] |
Data channel segments.
BArray<BdsDataStreamlet> Bds::DataFileBds::ostreamlets [private] |
Streamlet sequence numbers and positions.