CFEL - ASG Software Suite
2.5.0
CASS
|
A processor for a tag list. More...
Public Types | |
typedef std::tr1::shared_ptr< TagListProcessor > | shared_pointer |
typedef the shared pointer of this More... | |
Public Types inherited from lmf::PausableThread | |
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 | |
TagListProcessor (vector< int >::const_iterator liststart, vector< int >::const_iterator listend, int runNbr, int blNbr, int highTagNbr) | |
constructor More... | |
void | runthis () |
process the tags on the list More... | |
double | progress () |
retrieve the progess within the list More... | |
uint64_t | nEventsProcessed () |
retrieve the number of events processed by this thread More... | |
uint64_t | nEventsSkipped () |
retrieve the number of events skipped by this thread More... | |
Public Member Functions inherited from lmf::PausableThread | |
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 |
Public Member Functions inherited from QThread | |
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 | |
vector< int >::const_iterator | _liststart |
iterator to the start of the list More... | |
vector< int >::const_iterator | _listend |
iterator to the end of the list More... | |
vector< int >::const_iterator | _iter |
iterator to the current item being processed More... | |
int | _runNbr |
the run number for the experiment More... | |
int | _blNbr |
the beamline number for the experiment More... | |
int | _highTagNbr |
the first part of the tag (that doesn't change) More... | |
uint64_t | _counter |
a counter to count how many events (tags) have been processed More... | |
uint64_t | _skippedeventscounter |
a counter to count how many events (tags) have been skipped More... | |
Additional Inherited Members | |
Public Slots inherited from lmf::PausableThread | |
virtual void | end () |
tell the thread to quit More... | |
Protected Member Functions inherited from lmf::PausableThread | |
void | pausePoint () |
point where the thread will be paused More... | |
Protected Attributes inherited from lmf::PausableThread | |
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... | |
A processor for a tag list.
processes a list of tags. The list is given by iterators to the first and one beyond the last element that should be processed.
Definition at line 38 of file sacla_offline_input.cpp.
typedef std::tr1::shared_ptr<TagListProcessor> cass::TagListProcessor::shared_pointer |
typedef the shared pointer of this
Definition at line 42 of file sacla_offline_input.cpp.
|
inline |
constructor
inline set the provided parameters and intialize counter with 0
liststart | iterator to the start of the tag list |
listend | iterator to the end of the tag list |
blNbr | the beamline number of the experiment |
highTagNbr | the high tag number of the experiment |
Definition at line 53 of file sacla_offline_input.cpp.
|
inline |
retrieve the number of events processed by this thread
Definition at line 139 of file sacla_offline_input.cpp.
|
inline |
retrieve the number of events skipped by this thread
Definition at line 145 of file sacla_offline_input.cpp.
|
inline |
retrieve the progess within the list
Definition at line 128 of file sacla_offline_input.cpp.
|
inlinevirtual |
process the tags on the list
load the right reader for the file type depending on its extension
read and convert the info for each of the tags
get reference to the global input, which we use to interact with the ringbuffer and the ratemeter
reset the iterator to the start of the list and then iterate through the list of tags and check every iteration whether the input should quit
retrieve a new element from the ringbuffer, in case it is an iterator to the end of the buffer, continue to the next iterator of this list
fill the cassevent object with the contents from the file
in case nothing was retieved, issue a warning. Increase the counter otherwise
let the ratemeter know how much we retrieved and return the event to the ringbuffer
Implements lmf::PausableThread.
Definition at line 67 of file sacla_offline_input.cpp.
References cass::SACLAConverter::cacheParameters(), input, cass::SACLAConverter::loadSettings(), and cass::toString().
|
private |
the beamline number for the experiment
Definition at line 162 of file sacla_offline_input.cpp.
|
private |
a counter to count how many events (tags) have been processed
Definition at line 168 of file sacla_offline_input.cpp.
|
private |
the first part of the tag (that doesn't change)
Definition at line 165 of file sacla_offline_input.cpp.
|
private |
iterator to the current item being processed
Definition at line 155 of file sacla_offline_input.cpp.
|
private |
iterator to the end of the list
Definition at line 152 of file sacla_offline_input.cpp.
|
private |
iterator to the start of the list
Definition at line 149 of file sacla_offline_input.cpp.
|
private |
the run number for the experiment
Definition at line 159 of file sacla_offline_input.cpp.
|
private |
a counter to count how many events (tags) have been skipped
Definition at line 171 of file sacla_offline_input.cpp.