CFEL - ASG Software Suite
2.5.0
CASS
|
File Input for cass. More...
#include <file_input.h>
Public Member Functions | |
void | runthis () |
function with the main loop More... | |
void | load () |
load the parameters used for the multifile input More... | |
double | progress () |
retrieve the averaged progress state of all file processors More... | |
uint64_t | eventcounter () |
retrieve the number of processed events More... | |
uint64_t | skippedeventcounter () |
retrieve the number of skipped processed events More... | |
![]() | |
virtual | ~InputBase () |
destructor 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 (std::string filelistname, RingBuffer< CASSEvent > &, Ratemeter &ratemeter, Ratemeter &loadmeter, bool quitwhendone, 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< FileProcessor > > | fileProcessors_t |
define the container for all file processors More... | |
Private Member Functions | |
FileInput (std::string filelistname, RingBuffer< CASSEvent > &, Ratemeter &ratemeter, Ratemeter &loadmeter, bool quitwhendone, QObject *parent=0) | |
constructor More... | |
Private Attributes | |
bool | _parallelize |
flag that tells the input should analyze the files in parallel More... | |
bool | _quitWhenDone |
flag to tell the thread to quit when its done with all files More... | |
std::string | _filelistname |
name of the file containing all files that we need to process More... | |
fileProcessors_t | _fProcs |
the file processor container 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... | |
File Input for cass.
This class will be used in offline modus. I will take an string that contains a filename. In the file that the filename points to has to be a list with files, that one wants to analyze. The filename name must be passed to the program with the -i parameter.
For each file in the filelist it will open the file, and call the readers to extract the data from the file.
Definition at line 41 of file file_input.h.
|
private |
define the container for all file processors
Definition at line 115 of file file_input.h.
|
private |
constructor
filelistname | name of the file containing all files that should be processed |
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 |
quitwhendone | flag that tells this class that it should quit the Program when its done reading all events |
parent | The parent QT Object of this class |
Definition at line 180 of file file_input.cpp.
References cass::Log::add(), load(), and cass::Log::VERBOSEINFO.
|
virtual |
retrieve the number of processed events
Reimplemented from cass::InputBase.
Definition at line 281 of file file_input.cpp.
References _fProcs.
Referenced by runthis().
|
static |
create instance of this
filelistname | name of the file containing all files that should be processed |
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 |
quitwhendone | flag that tells this class that it should quit the Program when its done reading all events |
parent | The parent QT Object of this class |
Definition at line 169 of file file_input.cpp.
|
virtual |
load the parameters used for the multifile input
Implements cass::InputBase.
Definition at line 193 of file file_input.cpp.
References _parallelize, QSettings::beginGroup(), and QSettings::value().
Referenced by FileInput().
|
virtual |
retrieve the averaged progress state of all file processors
Reimplemented from cass::InputBase.
Definition at line 273 of file file_input.cpp.
References _fProcs.
|
virtual |
function with the main loop
retrieve all files in a list from the file
go through the list of files and create a processor for each file and add them to the list of processors
if there was such a file then we want to load it
process the files using the processors
wait until the processors are done and gather information about the number of events they processed.
Implements cass::InputBase.
Definition at line 200 of file file_input.cpp.
References _filelistname, _fProcs, _parallelize, _quitWhenDone, lmf::PausableThread::_status, cass::Log::add(), cass::Log::ERROR, eventcounter(), QFileInfo::exists(), QString::fromStdString(), cass::Log::INFO, info, lmf::PausableThread::running, lmf::PausableThread::shouldQuit(), QThread::sleep(), cass::toString(), and cass::Log::VERBOSEINFO.
|
virtual |
retrieve the number of skipped processed events
Reimplemented from cass::InputBase.
Definition at line 289 of file file_input.cpp.
References _fProcs.
|
private |
name of the file containing all files that we need to process
Definition at line 112 of file file_input.h.
Referenced by runthis().
|
private |
the file processor container
Definition at line 118 of file file_input.h.
Referenced by eventcounter(), progress(), runthis(), and skippedeventcounter().
|
private |
flag that tells the input should analyze the files in parallel
Definition at line 106 of file file_input.h.
|
private |
flag to tell the thread to quit when its done with all files
Definition at line 109 of file file_input.h.
Referenced by runthis().