23 :
QNamed(n), p_Reader(NULL), p_Writer(NULL), p_Driver(NULL) {
35 std::stringstream msg;
37 std::string smsg = msg.str();
39 std::string s =
"Sequence " +
GetName();
43 std::stringstream msg2;
47 std::string s =
"Sequence " +
GetName();
55 std::vector<QBaseModule*>::iterator it;
71 o <<
"Sequence: " <<
GetName() << std::endl;
72 std::vector<QBaseModule*>::iterator it;
73 std::vector<QBaseModule*> allModules =
modules;
77 for(it=allModules.begin(); it != allModules.end(); it++) {
83 o <<
"enabled" << std::endl;
85 o <<
"disabled" << std::endl;
87 o <<
"End of sequence: " <<
GetName();
99 std::string s =
"Sequence " +
GetName();
100 std::vector<QBaseModule*>::iterator it;
103 std::vector<QBaseModule*> allModules =
modules;
107 std::vector<QBaseModule*>::iterator m_iter = allModules.begin();
108 while(m_iter != allModules.end()) {
109 (*m_iter)->UpdateEnableFlag();
133 m_iter = allModules.begin();
134 while(m_iter != allModules.end()) {
135 (*m_iter)->Disable();
149 std::stringstream msg;
219 if (NumProcess == 0)
break;
228 std::stringstream msg;
273 std::stringstream msg;
299 std::vector<QBaseModule*>::iterator it;
300 std::vector<QBaseModule*> allModules =
modules;
304 std::string s =
"Sequence " +
GetName();
305 std::stringstream msg;
306 msg<<
"Modules that needed neigbours:";
308 for(it=allModules.begin(); it != allModules.end(); it++) {
328 if(caller!=firstCaller) {
330 err.SetDescription(
"JumpToEvent already owned by module:" + firstCaller->
GetName());
337 std::string s =
"Sequence " +
GetName();
338 std::stringstream estr;
339 std::string caller =
"unknown";
344 estr <<
"Detected error during sequence configuration \"" << caller
346 <<
"). Printing the event template";
break;
348 estr <<
"Detected error during module Init loop \"" << caller
350 <<
"). Printing the event template";
break;
352 estr <<
"Detected error in event loop, caller \"" << caller
354 <<
"). Printing the last event";
break;
359 estr<<
" and its "<<evList.
Size()<<
" neighbours:"<<std::endl;
360 else estr<<
":"<<std::endl;
363 std::stringstream estr2;
364 estr2<<
"Main Event: ";
368 for(
size_t i = 0; i < evList.
Size(); i++) {
369 std::stringstream estr;
370 estr<<
"Neighbour "<<i<<
": ";
371 evList[i].Dump(estr);
377 std::string s =
"Sequence " +
GetName();
378 std::stringstream estr;
379 estr<<
"Detected error in GlobalData. Printing GlobalData:"<<std::endl;
382 std::stringstream estr2;
403 std::string s =
"Sequence " +
GetName();
417 fwc = fwcHandle.
Get();
#define Q_BEGIN_NAMESPACE
template class to handle diana global QObject with QGlobalDataManager
const QError & GetError() const
Get I/O error.
bool IsValid() const
check QObject validity
void Set(const Q &obj)
set the QObject
const Q & Get() const
get the QObject
bool ProcessBase(QEventAssembler &ev, QEventList &evl, const bool exec, QEventList &ovl)
ProcessBase method is called for each event, getting the event and as argument.
void EndBase()
EndBase method is called after event loop.
void UpdateEnableFlag()
update enable flag
bool NeedNeighbours()
check wheter this module needs neighbours (available after the first event is processed)
void BeginBase(QEventAssembler &ev)
Begin Base method is called before event loop.
bool isEnabled() const
check if module is enabled
const std::string & GetName() const
Get Module name.
void SetModulesList(const std::vector< QBaseModule * > &modList)
method used by QSequence to set the list of modules in the QSequence
bool StopRun()
method used by QSequence to check if the run should be stopped
error class with error type and description
const std::string & GetDescription() const
get error description
Visitor class of QEvent that provides full handling of QEvent.
QEvent & GetEvent()
Get the QEvent.
void Consolidate()
Consolidate QEvent.
void Clear()
clear the underlying QEvent (calls QEvent::Clear())
list of references to const QEvent (s)
bool Empty() const
check if the list is empty
void Clear()
reset list to 0 elements
size_t Size() const
number of QEvent (s)
void Dump(std::ostream &o) const
Print the event and its member.
const std::string * GetOwner() const
get the name of the module that is currently acting on the event
QObject storing a set of QSecuenceConfigs.
std::vector< QSequenceConfig * > fSequences
QSequenceConfig of all sequences run on this data.
void SetOwner(const std::string &owner)
set the module that is accessing this object
void SetInputVersion(std::string versionTag)
set the version tag of the object to be read (default = this release)
QError Set(GlobalHandle< Q > *gh, const std::string &outSource, bool printError=true) const
Set a QObject using a GlobalHandle.
QError Get(const std::string &owner, GlobalHandle< Q > *gh, const std::string &inSource, bool printError=true) const
Get an object using a global handle.
void Dump(std::ostream &o) const
Dump cached objects to stream.
static QGlobalReaderDispatcher & GetInstance()
static QGlobalWriterDispatcher & GetInstance()
static QMessageHandler * Get()
void Send(MsgLevel l, const std::string &sender, const std::string &msg)
base class for anything that has a name
const std::string & GetName() const
void CheckNotGet(const std::string &seq, std::ostream &o)
int GetInt(const std::string &seq, const std::string &mod, size_t occ, const std::string &par)
static QOptions & GetInstance()
void CheckAtDefault(const std::string &seq, std::ostream &o)
process status and signal handler
void Notify()
acknowledge oldest process status contained in staus queue
bool isError() const
check wether an error occurred
const std::string & GetError() const
get error string
bool HasChanged() const
tell wehter process status has changed
static QProcessStatus & GetInstance()
get singleton Instance
bool isRunning() const
check wether current process status is QRunning_s
bool isExiting() const
check wether current process status is QExiting_s
QFrameWorkConfig fFrameWorkConfigOld
QRWCommon * fRWCommon
object to share file names with QWriter
const QError & BaseJumpToEvent(Long64_t eventnumber)
Called when another module ask for a specific event number in the next Do(), calls JumpToEvent()
void Clear()
clear members
std::vector< QModuleConfig * > fModules
ordered modules in this sequence
std::string fName
name of this sequence
const QError & JumpToEvent(Long64_t event, QBaseModule *caller)
Jump to an event in a particular in a module.
QSequence(const std::string &)
Ctor that takes the name of the sequence as argument.
virtual ~QSequence()
Default dtor.
SequenceStatus GetSequenceStatus() const
Get the sequence status (Config/Init/Do/Done)
static size_t fCounter
Static sequence counter.
unsigned int GetIteration() const
QGlobalDataManager fGlobalData
Global variables that a module can save.
QDriver * p_Driver
Pointer to a driver.
SequenceStatus fSequenceStatus
Status of the current sequence.
void PrintGlobal() const
Print the global data.
unsigned int fIteration
Iterations counter.
const QGlobalDataManager & GlobalData() const
Access to the global data manager for the sequence.
std::vector< QBaseModule * > modules
The list of the modules.
void Dump(std::ostream &) const
Dump the content of the sequence.
std::string GetReaderName() const
Get the name of the reader.
QWriter * p_Writer
Pointer to the writer.
QRWCommon fRWCommon
The Reader/Writer data shared between the reader and writer.
QReader * p_Reader
Pointer to the reader.
void SaveConfig()
Save the config data to file.
void PrintEvents(const QEvent &ev, const QEventList &evList) const
Print the event list.
std::string GetWriterName() const
Get the name of the writer.
bool Run()
The core of the sequence. Loops over Init's, Do's and Done's.
void CheckModuleWithNeighbours()
Check if any of the modules have neighbours.
QSequenceConfig fConfig
Sequence config data.
std::string GetDriverName() const
Get the name of the driver.
QRWCommon * fRWCommon
object to share file names with QReader