FRIBParallelanalysis
1.0
FrameworkforMPIParalleldataanalysisatFRIB
|
#include <TriggerSorter.h>
Public Member Functions | |
CTriggerSorter () | |
virtual | ~CTriggerSorter () |
void | addItem (pParameterItem item) |
void | flush () |
virtual void | emitItem (pParameterItem item)=0 |
CTriggerSorter has methods to add parameter ring items which may be out of order and then to emit ring items later in order.
This is implemented in a manner that does not depend on MPI so that ordinary unit tests can be used to verify the operation of the class. The idea is that addItem is called to add items to the sorting system. When one or more items can be emitted (because they have triggers sequential to the last emitted item), emitItem is called with those items.
emitItem is pure virtual so that derived classes can decide what to actually do with items that are sorted.
frib::analysis::CTriggerSorter::CTriggerSorter | ( | ) |
constructor The hardest part of the constructor is initializing the last emitted trigger... we emit it to 0-1 unsigned so that it + 1 (0) is the next trigger.
|
virtual |
destructor
Delete any remaining items.
void frib::analysis::CTriggerSorter::addItem | ( | pParameterItem | item | ) |
addItem
item | pointer to the item to add/sort/emit. |
void frib::analysis::CTriggerSorter::flush | ( | ) |
flush flush all elements of m_items -> emitItem