|
BdsApi
2.0.11
|
This class implements the BDS Data File/Stream access system. More...
#include <BdsDataFileBds.h>
Public Types | |
| enum | { StreamsMax = 256 } |
| enum | { DefaultBlockSize = 65536 } |
| enum | PackFormat { PackFormat_Unknown = 0, PackFormat_SM = 1, PackFormat_CM = 2, PackFormat_SM_CC = 3 } |
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 } |
Public Member Functions | |
| DataFileBds () | |
| ~DataFileBds () | |
| BError | open (BString fileName, BString mode) |
| Open the file for reading or writing. More... | |
| BError | close () |
| Close file. More... | |
| BError | setFormat (BString format) |
| Sets the sub-format. More... | |
| BError | setInfo (DataInfo &dataInfo, ChannelInfos &channelInfos, WriteOptionsList options=WriteOptionSensorData) |
| Sets the information. More... | |
| BError | writeData (DataBlock &data) |
| Writes a data block to the file. More... | |
| DataOrder | getDataOrder () |
| Get the expected order of writing data, by sample or by channel. More... | |
| BError | getInfo (DataInfo &dataInfo, DataFileOptions options, BList< DataError > &errors) |
| Get information on open file. More... | |
| 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. More... | |
| 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. More... | |
| BError | setDiskBlockSize (BUInt32 blockSize) |
| Sets up file/stream block size. More... | |
| BUInt32 | getDiskBlockSize () |
| Returns the data block size in bytes. More... | |
Public Member Functions inherited from Bds::DataFile | |
| DataFile () | |
| virtual | ~DataFile () |
| virtual void | init () |
| Initialise. More... | |
| virtual BString | getFileName () |
| Return the file name. More... | |
| virtual int | getFeatures () |
| Get bitmask of supported features. More... | |
| virtual BError | start (BUInt channel, BUInt segment) |
| Start next segment of data. More... | |
| virtual BError | end () |
| End segment. More... | |
| virtual BError | fileNameProcess () |
| Parse the file name for a date/time. More... | |
| virtual BError | getFormat (BString &format) |
| Get sub-format. 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 () |
| Get the names of the supported formats. More... | |
Static Public Member Functions inherited from Bds::DataFile | |
| static DataFormat | getFormats () |
| Get list of supported formats. More... | |
Private Member Functions | |
| void | clear () |
| BError | setInfoRepeat (BUInt32 repeat) |
| Sets the reapeat period for the information packets. More... | |
| BError | infoSet (BUInt32 streamlet, BTimeStamp startTime, BTimeStamp endTime, BDictString &info) |
| Sets the information packet and writes this to the file/stream. More... | |
| BError | infoGet (BdsDataPacket &packet, BDictString &info) |
| Gets the information from an information packet. More... | |
| BError | addInfoPacket () |
| BError | addInfoExtraPacket () |
| BError | streamletFromChannel (BUInt channel, BUInt &streamlet) |
| Find streamlet given channel. More... | |
| BError | dataAppend (DataBlock &data) |
| Appends a data block to the file. More... | |
| BError | dataGet (BUInt channel, BdsDataPacket &packet, DataBlock &data) |
| Gets the data from a data packet. More... | |
| BError | packetRead (BdsDataPacket &packet) |
| Reads a packet from the file. More... | |
| BError | packetWrite (BdsDataPacket &packet) |
| Writes a packet to the file. More... | |
| void | diskBlockReset () |
| Resets to disk block 0. More... | |
| BError | diskBlockWrite (void *data, BUInt32 numBytes, int header=0) |
| Writes data to a block in the file. More... | |
| BError | diskBlockWriteFlush () |
| Flushes a semi-filled block to the file. More... | |
| BError | diskBlockRead (void *data, BUInt32 numBytes, int header=0) |
| Reads data from a block. More... | |
| BError | diskBlockSeek (BUInt64 position) |
Private Attributes | |
| BString | oformat |
| The format. More... | |
| PackFormat | opackFormat |
| The data packet format. More... | |
| DataInfo | odataInfo |
| Information on the channel data. More... | |
| ChannelInfos | ochannelInfos |
| Channel meta data information. More... | |
| BUInt32 | oinfoRepeat |
| How often to output info packet. More... | |
| BDictString | oinfo |
| Info packet output. More... | |
| BdsDataPacketHeader | oinfoHeader |
| Info packet header. More... | |
| BUInt32 | odiskBlockSize |
| The block size. More... | |
| BdsDataBlock * | odiskBlock |
| Data block buffer. More... | |
| BUInt64 | odiskPosition |
| The disk block position. More... | |
| BArray< BdsDataStreamlet > | ostreamlets |
| Streamlet sequence numbers and positions. More... | |
| BdsDataPacket | opacket |
| Temporary packet for header/data packet generation. More... | |
| BArray< BdsDataSegment > | osegments |
| Data channel segments. More... | |
| BArray< BArray< BdsDataBlockPos > > | oblockPositions |
| Data block positions for seeking. More... | |
Additional Inherited Members | |
Protected Attributes inherited from Bds::DataFile | |
| BString | ofileName |
| BString | omode |
| BTimeStamp | ofileNameTime |
| BFile | ofile |
| BString | oformat |
This class implements the BDS Data File/Stream access system.
| Bds::DataFileBds::DataFileBds | ( | ) |
| Bds::DataFileBds::~DataFileBds | ( | ) |
|
private |
|
private |
|
private |
|
virtual |
Close file.
Reimplemented from Bds::DataFile.
|
private |
Appends a data block to the file.
|
private |
Gets the data from a data packet.
|
private |
Reads data from a block.
|
private |
Resets to disk block 0.
|
private |
|
private |
Writes data to a block in the file.
|
private |
Flushes a semi-filled block to the file.
|
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.
|
static |
Get the names of the supported formats.
|
virtual |
Get information on open file.
Reimplemented from Bds::DataFile.
|
private |
Gets the information from an information packet.
|
private |
Sets the information packet and writes this to the file/stream.
|
virtual |
Open the file for reading or writing.
Reimplemented from Bds::DataFile.
|
private |
Reads a packet from the file.
|
private |
Writes a packet to the file.
|
virtual |
Read the data block for the given channel or all channels if blockNumber is 0.
Reimplemented from Bds::DataFile.
|
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.
|
virtual |
Sets the sub-format.
Reimplemented from Bds::DataFile.
|
virtual |
Sets the information.
Reimplemented from Bds::DataFile.
|
private |
Sets the reapeat period for the information packets.
|
private |
Find streamlet given channel.
|
virtual |
Writes a data block to the file.
Reimplemented from Bds::DataFile.
|
private |
Data block positions for seeking.
|
private |
Channel meta data information.
|
private |
Information on the channel data.
|
private |
Data block buffer.
|
private |
The block size.
|
private |
The disk block position.
|
private |
The format.
|
private |
Info packet output.
|
private |
Info packet header.
|
private |
How often to output info packet.
|
private |
Temporary packet for header/data packet generation.
|
private |
The data packet format.
|
private |
Data channel segments.
|
private |
Streamlet sequence numbers and positions.
1.8.5