CFEL - ASG Software Suite
2.5.0
CASS
|
process a file More...
Public Types | |
typedef std::tr1::shared_ptr< FileProcessor > | shared_pointer |
define the shared pointer of this More... | |
![]() | |
enum | status_t { running, paused, notstarted } |
enum describing the internal status of the thread More... | |
enum | control_t { _run, _quit, _pause } |
enum describing the control status of the thread More... | |
enum | exception_t { NO_EXCEPTION, INVALID_ARGUMENT_EXCEPTION, RUNTIME_ERROR_EXCEPTION, OUT_OF_RANGE_EXCEPTION, LOGIC_ERROR_EXCEPTION, STANDART_EXCEPTION, UNKNOWN_EXCEPTION } |
enum describing which exception was thrown More... | |
Public Member Functions | |
FileProcessor (const string &filename) | |
constructor More... | |
void | runthis () |
process the file More... | |
double | progress () |
retrieve the progess within the file More... | |
uint64_t | nEventsProcessed () |
retrieve the number of events processed by this thread More... | |
uint64_t | nSkippedEvents () |
retrieve the number of skipped events by this thread More... | |
![]() | |
PausableThread (control_t control=_run, QObject *parent=0) | |
constructor More... | |
virtual | ~PausableThread () |
destructor More... | |
void | run () |
run the thread More... | |
void | pause (bool block=false) |
pause the thread More... | |
void | waitUntilPaused () |
waits until thread is paused More... | |
void | resume () |
resume the thread More... | |
status_t | status () const |
return the current status of the thread More... | |
bool | shouldQuit () const |
query whether this thread is told to quit More... | |
void | rethrowException () const |
rethrow the thrown exception More... | |
exception_t | exceptionThrown () const |
![]() | |
QThread (QObject *parent=0) | |
currentThread () | |
HANDLE QThread::currentThreadId() | |
exec () | |
exit (int returnCode=0) | |
finished () | |
idealThreadCount () | |
isFinished () | |
isRunning () | |
msleep (unsigned long msecs) | |
priority () | |
quit () | |
run () | |
setPriority (Priority priority) | |
setStackSize (uint stackSize) | |
setTerminationEnabled (bool enabled=true) | |
sleep (unsigned long secs) | |
stackSize () | |
start (Priority priority=InheritPriority) | |
started () | |
terminate () | |
terminated () | |
usleep (unsigned long usecs) | |
wait (unsigned long time=ULONG_MAX) | |
yieldCurrentThread () | |
Private Attributes | |
string | _filename |
the filename to work on More... | |
FileReader::shared_pointer | _read |
shared pointer to the actual reader More... | |
ifstream | _file |
the file stream More... | |
streampos | _filesize |
the size of the file More... | |
uint64_t | _counter |
a counter for the events More... | |
uint64_t | _skippedcounter |
a counter for the skipped events More... | |
Additional Inherited Members | |
![]() | |
virtual void | end () |
tell the thread to quit More... | |
![]() | |
void | pausePoint () |
point where the thread will be paused More... | |
![]() | |
QMutex | _pauseMutex |
mutex to wait on until thread is paused More... | |
QWaitCondition | _pauseCondition |
wait condition to wait on until thread is resumed More... | |
QWaitCondition | _waitUntilPausedCondition |
wait condition to wait unitl thread is paused More... | |
status_t | _status |
the internal status of the thread More... | |
control_t | _control |
the internal control status of the thread More... | |
size_t | _pausecount |
a counter how many threads have pause this thread More... | |
exception_t | _exception_thrown |
flag to show that general exception was thrown More... | |
std::invalid_argument | _invarg_excep |
the invalid arguemnt exception thrown More... | |
std::runtime_error | _runt_excep |
the invalid arguemnt exception thrown More... | |
std::out_of_range | _outrange_excep |
the invalid arguemnt exception thrown More... | |
std::logic_error | _logic_excep |
the invalid arguemnt exception thrown More... | |
process a file
Definition at line 33 of file file_input.cpp.
typedef std::tr1::shared_ptr<FileProcessor> cass::FileProcessor::shared_pointer |
define the shared pointer of this
Definition at line 37 of file file_input.cpp.
|
inline |
constructor
set the filename and initializes all parameters for the thread to be able to process the data
filename | The name of the file to process |
load the right reader for the file type depending on its extension
Definition at line 46 of file file_input.cpp.
|
inline |
retrieve the number of events processed by this thread
Definition at line 139 of file file_input.cpp.
|
inline |
retrieve the number of skipped events by this thread
Definition at line 145 of file file_input.cpp.
|
inline |
retrieve the progess within the file
Definition at line 128 of file file_input.cpp.
|
inlinevirtual |
process the file
get a pointer to the calling thread
make a container with all event ids
iterate through the file until we've reached the filesize
retrieve a new element from the ringbuffer
fill the cassevent object with the contents from the file
check if id is unique, if not skip event
give item back to the ringbuffer
Implements lmf::PausableThread.
Definition at line 64 of file file_input.cpp.
References input, and cass::toString().
|
private |
a counter for the events
Definition at line 161 of file file_input.cpp.
|
private |
the file stream
Definition at line 155 of file file_input.cpp.
|
private |
the filename to work on
Definition at line 149 of file file_input.cpp.
|
private |
the size of the file
Definition at line 158 of file file_input.cpp.
|
private |
shared pointer to the actual reader
Definition at line 152 of file file_input.cpp.
|
private |
a counter for the skipped events
Definition at line 164 of file file_input.cpp.