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

Testing Input for cass. More...

#include <test_input.h>

+ Inheritance diagram for cass::TestInput:
+ Collaboration diagram for cass::TestInput:

Public Member Functions

void run ()
 function with the main loop More...
 
void load ()
 load the parameters used for the input More...
 
- Public Member Functions inherited from cass::InputBase
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...
 
- 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 ()
 

Static Public Member Functions

static void instance (RingBuffer< CASSEvent > &, Ratemeter &ratemeter, Ratemeter &loadmeter, QObject *parent=0)
 create instance of this More...
 
- Static Public Member Functions inherited from cass::InputBase
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

- Public Types inherited from cass::InputBase
typedef std::tr1::shared_ptr< InputBaseshared_pointer
 shared pointer of this type More...
 
typedef RingBuffer< CASSEvent >::iter_type rbItem_t
 define an item in the ringbuffer 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 Slots inherited from lmf::PausableThread
virtual void end ()
 tell the thread to quit More...
 
- Public Attributes inherited from cass::InputBase
QMutex lock
 a mutex so that external program can lock access to this More...
 
- Protected Member Functions inherited from cass::InputBase
 InputBase (RingBuffer< CASSEvent > &ringbuffer, Ratemeter &ratemeter, Ratemeter &loadmeter, QObject *parent=0)
 protected constructor since it should be a singelton More...
 
- Protected Member Functions inherited from lmf::PausableThread
void pausePoint ()
 point where the thread will be paused More...
 
- Protected Attributes inherited from cass::InputBase
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...
 
- 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...
 
- Static Protected Attributes inherited from cass::InputBase
static shared_pointer _instance
 singelton instance More...
 

Detailed Description

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.

User definable Parameters:
TestInput/{key}
See Data-Generators List for a list of all possible values.
Author
Lutz Foucar

Definition at line 37 of file test_input.h.

Member Typedef Documentation

typedef std::vector<std::tr1::shared_ptr<DataGenerator> > cass::TestInput::generators_t
private

define a container for all data generators

Definition at line 72 of file test_input.h.

Constructor & Destructor Documentation

TestInput::TestInput ( RingBuffer< CASSEvent > &  ringbuffer,
Ratemeter ratemeter,
Ratemeter loadmeter,
QObject parent = 0 
)
private

constructor

Parameters
ringbufferreference to the ringbuffer containing the CASSEvents
ratemeterreference to the ratemeter to measure the rate of the input
loadmeterreference to the ratemeter to measure the load of the input
parentThe parent QT Object of this class

Definition at line 40 of file test_input.cpp.

References cass::Log::add(), load(), and cass::Log::VERBOSEINFO.

Member Function Documentation

void TestInput::instance ( RingBuffer< CASSEvent > &  ringbuffer,
Ratemeter ratemeter,
Ratemeter loadmeter,
QObject parent = 0 
)
static

create instance of this

Parameters
ringbufferreference to the ringbuffer containing the CASSEvents
ratemeterreference to the ratemeter to measure the rate of the input
loadmeterreference to the ratemeter to measure the load of the input
parentThe parent QT Object of this class

Definition at line 31 of file test_input.cpp.

void TestInput::load ( )
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 ( )

Member Data Documentation

size_t cass::TestInput::_counter
private

a counter to create a fake event id

Definition at line 78 of file test_input.h.

Referenced by run().

generators_t cass::TestInput::_generators
private

container for all used fillers

Definition at line 75 of file test_input.h.

Referenced by load(), and run().


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