CFEL - ASG Software Suite
2.5.0
CASS
|
Testing Input for cass. More...
#include <test_input.h>
Public Member Functions | |
void | run () |
function with the main loop More... | |
void | load () |
load the parameters used for the input More... | |
![]() | |
virtual | ~InputBase () |
destructor More... | |
virtual void | runthis ()=0 |
function with the main loop More... | |
virtual double | progress () |
retrieve the fraction of how much of the input has been processed More... | |
virtual uint64_t | eventcounter () |
retrieve the number of events that have been input so far More... | |
virtual uint64_t | skippedeventcounter () |
retrieve the number of skipped events that have been input so far More... | |
void | newEventAdded (const size_t eventsize) |
increment the numer of events received in the ratemeter More... | |
RingBuffer< CASSEvent > & | ringbuffer () |
retrieve a reference to the the ringbuffer More... | |
rbItem_t | getNextFillable (unsigned timeout=500) |
retrieve an iterator to the next fillable event 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 () | |
Static Public Member Functions | |
static void | instance (RingBuffer< CASSEvent > &, Ratemeter &ratemeter, Ratemeter &loadmeter, QObject *parent=0) |
create instance of this More... | |
![]() | |
static shared_pointer | instance () |
get the signelton instance More... | |
static shared_pointer::element_type & | reference () |
get reference to the singelton instance More... | |
Private Types | |
typedef std::vector< std::tr1::shared_ptr< DataGenerator > > | generators_t |
define a container for all data generators More... | |
Private Member Functions | |
TestInput (RingBuffer< CASSEvent > &, Ratemeter &ratemeter, Ratemeter &loadmeter, QObject *parent=0) | |
constructor More... | |
Private Attributes | |
generators_t | _generators |
container for all used fillers More... | |
size_t | _counter |
a counter to create a fake event id More... | |
Additional Inherited Members | |
![]() | |
typedef std::tr1::shared_ptr< InputBase > | shared_pointer |
shared pointer of this type More... | |
typedef RingBuffer< CASSEvent >::iter_type | rbItem_t |
define an item in the ringbuffer 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... | |
![]() | |
virtual void | end () |
tell the thread to quit More... | |
![]() | |
QMutex | lock |
a mutex so that external program can lock access to this More... | |
![]() | |
InputBase (RingBuffer< CASSEvent > &ringbuffer, Ratemeter &ratemeter, Ratemeter &loadmeter, QObject *parent=0) | |
protected constructor since it should be a singelton More... | |
![]() | |
void | pausePoint () |
point where the thread will be paused More... | |
![]() | |
RingBuffer< CASSEvent > & | _ringbuffer |
reference to the ringbuffer More... | |
Ratemeter & | _ratemeter |
ratemeter to measure the rate More... | |
Ratemeter & | _loadmeter |
meter to measure the data load 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... | |
![]() | |
static shared_pointer | _instance |
singelton instance More... | |
Testing Input for cass.
It should be used when testing cass.
It will fill the cassevents with data for several devices, such that PostProcessors can be tested. It uses the data generators to fill the cassevents.
Definition at line 37 of file test_input.h.
|
private |
define a container for all data generators
Definition at line 72 of file test_input.h.
|
private |
constructor
ringbuffer | reference to the ringbuffer containing the CASSEvents |
ratemeter | reference to the ratemeter to measure the rate of the input |
loadmeter | reference to the ratemeter to measure the load of the input |
parent | The parent QT Object of this class |
Definition at line 40 of file test_input.cpp.
References cass::Log::add(), load(), and cass::Log::VERBOSEINFO.
|
static |
create instance of this
ringbuffer | reference to the ringbuffer containing the CASSEvents |
ratemeter | reference to the ratemeter to measure the rate of the input |
loadmeter | reference to the ratemeter to measure the load of the input |
parent | The parent QT Object of this class |
Definition at line 31 of file test_input.cpp.
|
virtual |
load the parameters used for the input
Implements cass::InputBase.
Definition at line 49 of file test_input.cpp.
References _generators, QSettings::beginGroup(), cass::Factory< Base >::create(), and QSettings::value().
Referenced by TestInput().
void TestInput::run | ( | ) |
function with the main loop
retrieve a new element from the ringbuffer
fill the cassevent object with help of the fillers
Definition at line 67 of file test_input.cpp.
References lmf::PausableThread::_control, _counter, _generators, lmf::PausableThread::_quit, cass::InputBase::_ringbuffer, lmf::PausableThread::_status, cass::Log::add(), cass::CASSEvent::datagrambuffer(), cass::Log::ERROR, cass::CASSEvent::id(), cass::Log::INFO, cass::InputBase::newEventAdded(), and lmf::PausableThread::running.
|
private |
a counter to create a fake event id
Definition at line 78 of file test_input.h.
Referenced by run().
|
private |
container for all used fillers
Definition at line 75 of file test_input.h.