XCube Stream Reader SDK
|
Class definition of file reader. More...
#include <CFileReader.h>
Public Member Functions | |
CFileReader (const char *inFileName, CPacketBuffer *pktBuf, size_t chunkSz) | |
Constructor. | |
virtual | ~CFileReader () |
De-constructor. | |
void | init (UINT64 offset) throw (IoException) |
Initialize file reader. | |
void | initWithTimeFilter (UINT64 timeVal) throw (IoException) |
void | start () |
Start the reader thread and open the files. | |
void | stop () |
Stop the reader thread and close the files. | |
void | reset (UINT64 timeVal) |
Reset the CFileReader. | |
void | resume () |
Resume the CFileReader after calling CFileReader::reset() |
Class definition of file reader.
this CFileReder class provides functions to read data from x3c files into buffers which can be used for other purpose, such as replay data, restore data... Each file reader has its own packet buffer to write data to and it is also associated with one x3c file which it reads data from. As long as user start a file reader, it will open its x3c file and read data into its packet buffer until packet buffer is full, then it will wait until packet buffer is available for next chunk of data. This process can be terminated by a stop call or until it reaches the end of its x3c file.
CFileReader::CFileReader | ( | const char * | inFileName, |
CPacketBuffer * | pktBuf, | ||
size_t | chunkSz | ||
) |
Constructor.
Create a new File Reader that reads from the file "infile" to the packet buffer and have the preferred read set to 'chunk size'
inFileName | - the full filename of the stream to read from |
pktBuf | - the packet buffer to write to |
chunkSz | - the preferred read size in MByte |
virtual CFileReader::~CFileReader | ( | ) | [virtual] |
De-constructor.
Clean a file reader, close the file if it is not closed, clean the file name pointer if it is not null
void CFileReader::init | ( | UINT64 | offset | ) | throw (IoException) |
Initialize file reader.
Initialize the file reader and start reading at offset. Can only be called once
offset | - the offset to start reading |
void CFileReader::reset | ( | UINT64 | timeVal | ) |
Reset the CFileReader.
Reset the CFileReader to a position in the stream corresponding to timeVal
After calling this funcion the CFileReader will be reset but will not be restarted until a call to CFileReader::resume()
is made.