CFEL - ASG Software Suite  2.5.0
CASS
Public Types | Public Member Functions | Private Attributes | List of all members
cass::TagListProcessor Class Reference

A processor for a tag list. More...

+ Inheritance diagram for cass::TagListProcessor:
+ Collaboration diagram for cass::TagListProcessor:

Public Types

typedef std::tr1::shared_ptr< TagListProcessorshared_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...
 

Detailed Description

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.

Author
Lutz Foucar

Definition at line 38 of file sacla_offline_input.cpp.

Member Typedef Documentation

typedef the shared pointer of this

Definition at line 42 of file sacla_offline_input.cpp.

Constructor & Destructor Documentation

cass::TagListProcessor::TagListProcessor ( vector< int >::const_iterator  liststart,
vector< int >::const_iterator  listend,
int  runNbr,
int  blNbr,
int  highTagNbr 
)
inline

constructor

inline set the provided parameters and intialize counter with 0

Parameters
liststartiterator to the start of the tag list
listenditerator to the end of the tag list
blNbrthe beamline number of the experiment
highTagNbrthe high tag number of the experiment

Definition at line 53 of file sacla_offline_input.cpp.

Member Function Documentation

uint64_t cass::TagListProcessor::nEventsProcessed ( )
inline

retrieve the number of events processed by this thread

Returns
the number of processed events

Definition at line 139 of file sacla_offline_input.cpp.

uint64_t cass::TagListProcessor::nEventsSkipped ( )
inline

retrieve the number of events skipped by this thread

Returns
the number of skipped events

Definition at line 145 of file sacla_offline_input.cpp.

double cass::TagListProcessor::progress ( )
inline

retrieve the progess within the list

Returns
the current progress

Definition at line 128 of file sacla_offline_input.cpp.

void cass::TagListProcessor::runthis ( )
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().

Member Data Documentation

int cass::TagListProcessor::_blNbr
private

the beamline number for the experiment

Definition at line 162 of file sacla_offline_input.cpp.

uint64_t cass::TagListProcessor::_counter
private

a counter to count how many events (tags) have been processed

Definition at line 168 of file sacla_offline_input.cpp.

int cass::TagListProcessor::_highTagNbr
private

the first part of the tag (that doesn't change)

Definition at line 165 of file sacla_offline_input.cpp.

vector<int>::const_iterator cass::TagListProcessor::_iter
private

iterator to the current item being processed

Definition at line 155 of file sacla_offline_input.cpp.

vector<int>::const_iterator cass::TagListProcessor::_listend
private

iterator to the end of the list

Definition at line 152 of file sacla_offline_input.cpp.

vector<int>::const_iterator cass::TagListProcessor::_liststart
private

iterator to the start of the list

Definition at line 149 of file sacla_offline_input.cpp.

int cass::TagListProcessor::_runNbr
private

the run number for the experiment

Definition at line 159 of file sacla_offline_input.cpp.

uint64_t cass::TagListProcessor::_skippedeventscounter
private

a counter to count how many events (tags) have been skipped

Definition at line 171 of file sacla_offline_input.cpp.


The documentation for this class was generated from the following file: