#include <BufferedSDIFFileReader.hxx>
Instances can be given a thread (presumably from a thread pool) so that the SDIF frames will be loaded in the background.
Definition at line 38 of file BufferedSDIFFileReader.hxx.
Public Member Functions | |
BufferedSDIFFileReader (const SDIFInConfig &argSDIFInConfig) | |
You MUST give the instance the filename of the SDIF file to read. | |
virtual | ~BufferedSDIFFileReader () |
bool | Configure (const SDIFInConfig &c) |
You MUST to give the instance the filename of the SDIF file to read. | |
const SDIFInConfig | GetConfig () |
virtual Frame * | ReadFrame () |
This method returns the next frame from the internal buffer. | |
void | LoadFramesIntoBufferOnThread (Thread *argThread) |
Use this method to give the instance a thread which it can use to load the SDIF file in the background. | |
void | StopLoadingFramesIntoBufferOnThread () |
This method stops the thread given to this object. | |
bool | IsThreaded () |
True if and only if this has a thread. | |
int | GetNumberOfFramesLoaded () |
The number of frames that have been read into the buffer. | |
Protected Member Functions | |
int | GetFrameBufferPosition () |
void | SetFrameBufferPosition (int frameBufferPosition) |
Frame * | GetFrame (int frameBufferPosition) |
CLAM::BufferedSDIFFileReader::BufferedSDIFFileReader | ( | const SDIFInConfig & | argSDIFInConfig | ) |
You MUST give the instance the filename of the SDIF file to read.
in the SDIFInConfig object.
Definition at line 8 of file BufferedSDIFFileReader.cxx.
References Configure().
CLAM::BufferedSDIFFileReader::~BufferedSDIFFileReader | ( | ) | [virtual] |
Definition at line 23 of file BufferedSDIFFileReader.cxx.
bool CLAM::BufferedSDIFFileReader::Configure | ( | const SDIFInConfig & | c | ) |
You MUST to give the instance the filename of the SDIF file to read.
in the SDIFInConfig object. You can further specify which kinds of objects to read from the SDIFFile. See the doc for SDIFInConfig.
Reimplemented in CLAM::LoopingSDIFFileReader.
Definition at line 31 of file BufferedSDIFFileReader.cxx.
References CLAM::SDIFFileReader::Configure(), and DEFAULT_INITIAL_NUMBER_OF_FRAMES_TO_BUFFER.
Referenced by BufferedSDIFFileReader().
const SDIFInConfig CLAM::BufferedSDIFFileReader::GetConfig | ( | ) |
Definition at line 64 of file BufferedSDIFFileReader.cxx.
References CLAM::SDIFFileReader::GetConfig().
Frame * CLAM::BufferedSDIFFileReader::ReadFrame | ( | ) | [virtual] |
This method returns the next frame from the internal buffer.
Reimplemented in CLAM::LoopingSDIFFileReader.
Definition at line 88 of file BufferedSDIFFileReader.cxx.
References NULL.
Referenced by CLAM::LoopingSDIFFileReader::ReadFrame().
void CLAM::BufferedSDIFFileReader::LoadFramesIntoBufferOnThread | ( | Thread * | argThread | ) |
Use this method to give the instance a thread which it can use to load the SDIF file in the background.
Definition at line 181 of file BufferedSDIFFileReader.cxx.
References CLAM_ASSERT, NULL, CLAM::Thread::SetThreadCode(), and CLAM::Thread::Start().
void CLAM::BufferedSDIFFileReader::StopLoadingFramesIntoBufferOnThread | ( | ) |
This method stops the thread given to this object.
This should never (?) be called however by a client because this class knows when it no longer needs its thread uses this method to stop the thread itself.
TODO should this be protected?
Definition at line 203 of file BufferedSDIFFileReader.cxx.
References NULL.
bool CLAM::BufferedSDIFFileReader::IsThreaded | ( | ) |
True if and only if this has a thread.
Definition at line 220 of file BufferedSDIFFileReader.cxx.
References NULL.
int CLAM::BufferedSDIFFileReader::GetNumberOfFramesLoaded | ( | ) |
The number of frames that have been read into the buffer.
Definition at line 175 of file BufferedSDIFFileReader.cxx.
int CLAM::BufferedSDIFFileReader::GetFrameBufferPosition | ( | ) | [protected] |
Definition at line 69 of file BufferedSDIFFileReader.cxx.
Referenced by CLAM::LoopingSDIFFileReader::ReadFrame().
void CLAM::BufferedSDIFFileReader::SetFrameBufferPosition | ( | int | frameBufferPosition | ) | [protected] |
Definition at line 74 of file BufferedSDIFFileReader.cxx.
Referenced by CLAM::LoopingSDIFFileReader::ReadFrame(), and CLAM::LoopingSDIFFileReader::Reset().
Definition at line 79 of file BufferedSDIFFileReader.cxx.
Referenced by CLAM::LoopingSDIFFileReader::ReadFrame().