Marlin
01.17.01
|
Processor manager singleton class. More...
#include <ProcessorMgr.h>
Public Member Functions | |
virtual | ~ProcessorMgr () |
destructor deletes ProcessorEventSeeder More... | |
bool | addActiveProcessor (const std::string &processorType, const std::string &processorName, std::shared_ptr< StringParameters > parameters, const std::string condition="true") |
Add a processor of type processorType with name processorName to the list of active processors. More... | |
void | removeActiveProcessor (const std::string &name) |
Remove processor with name from list of active processors. More... | |
Processor * | getActiveProcessor (const std::string &name) |
Return the active processor with the given name. More... | |
Processor * | getProcessor (const std::string &type) |
Return the processor that has been registered with the given type. More... | |
void | dumpRegisteredProcessors () |
Dump information of all registered processors to stdout. More... | |
void | dumpRegisteredProcessorsXML () |
Dump information of all registered processors in XML format to stdout. More... | |
virtual void | init () |
virtual void | processRunHeader (LCRunHeader *) |
virtual void | processEvent (LCEvent *) |
virtual void | end () |
virtual void | modifyRunHeader (LCRunHeader *) |
virtual void | modifyEvent (LCEvent *) |
virtual void | readDataSource (int numEvents) |
Calls readDataSource() for all Processors of type DataSourceProcessor. More... | |
virtual void | setProcessorReturnValue (Processor *proc, bool val) |
Set the return value for the given processor. More... | |
virtual void | setProcessorReturnValue (Processor *proc, bool val, const std::string &name) |
Set the named return value for the given processor. More... | |
Static Public Member Functions | |
static ProcessorMgr * | instance () |
Return the instance of this manager. More... | |
Protected Member Functions | |
void | registerProcessor (Processor *processor) |
Register a processor with the given name. More... | |
std::set< std::string > | getAvailableProcessorTypes () |
Returns a list of all registered processors found. More... | |
ProcessorMgr () | |
Private Attributes | |
ProcessorMap | _map {} |
ProcessorMap | _activeMap {} |
ProcessorList | _list {} |
SkippedEventMap | _skipMap {} |
ProcessorList | _eventModifierList {} |
LogicalExpressions | _conditions {} |
Static Private Attributes | |
static ProcessorMgr * | _me = 0 |
Friends | |
class | Processor |
class | CMProcessor |
class | MarlinSteerCheck |
Processor manager singleton class.
Holds references to all registered Processors.
Responsible for creating the instance of ProcessorEventSeeder and setting the Global::EVENTSEEDER variable.
Definition at line 36 of file ProcessorMgr.h.
|
virtual |
destructor deletes ProcessorEventSeeder
Definition at line 70 of file ProcessorMgr.cc.
|
protected |
Definition at line 48 of file ProcessorMgr.cc.
References std::endl(), marlin::Global::EVENTSEEDER, and std::stringstream::str().
Referenced by instance().
bool marlin::ProcessorMgr::addActiveProcessor | ( | const std::string & | processorType, |
const std::string & | processorName, | ||
std::shared_ptr< StringParameters > | parameters, | ||
const std::string | condition = "true" |
||
) |
Add a processor of type processorType with name processorName to the list of active processors.
Initializes the parameters (if != 0).Add a processor of type processorType with name processorName to the list of active processors including a condition for the execution of the processEvent() method.
Definition at line 224 of file ProcessorMgr.cc.
References _activeMap, _conditions, _list, marlin::LogicalExpressions::addCondition(), std::map< K, T >::end(), std::endl(), std::map< K, T >::find(), getProcessor(), marlin::Processor::newProcessor(), std::list< T >::push_back(), marlin::Processor::setName(), marlin::Processor::setParameters(), and std::stringstream::str().
void marlin::ProcessorMgr::dumpRegisteredProcessors | ( | ) |
Dump information of all registered processors to stdout.
Definition at line 105 of file ProcessorMgr.cc.
References _map, std::map< K, T >::begin(), std::map< K, T >::end(), and std::endl().
void marlin::ProcessorMgr::dumpRegisteredProcessorsXML | ( | ) |
Dump information of all registered processors in XML format to stdout.
Definition at line 140 of file ProcessorMgr.cc.
References _map, std::map< K, T >::begin(), std::map< K, T >::end(), and std::endl().
|
virtual |
Definition at line 529 of file ProcessorMgr.cc.
References _activeMap, _list, _map, _me, _skipMap, std::back_inserter(), std::map< K, T >::begin(), std::map< K, T >::clear(), std::list< T >::clear(), std::copy(), std::map< K, T >::end(), std::endl(), marlin::Global::EVENTSEEDER, marlin::my_cout, std::list< T >::rbegin(), std::list< T >::rend(), std::scientific(), std::setw(), std::string::size(), and marlin::tMap.
Processor * marlin::ProcessorMgr::getActiveProcessor | ( | const std::string & | name | ) |
Return the active processor with the given name.
NULL if no processor exists.
Definition at line 211 of file ProcessorMgr.cc.
References _activeMap.
|
protected |
Returns a list of all registered processors found.
Definition at line 197 of file ProcessorMgr.cc.
References _map, std::map< K, T >::begin(), std::map< K, T >::end(), and std::set< K >::insert().
Processor * marlin::ProcessorMgr::getProcessor | ( | const std::string & | type | ) |
Return the processor that has been registered with the given type.
NULL if no processor exists.
Definition at line 207 of file ProcessorMgr.cc.
References _map.
Referenced by addActiveProcessor(), and marlin::XMLFixCollTypes::parse().
|
virtual |
Definition at line 268 of file ProcessorMgr.cc.
References _eventModifierList, _list, std::list< T >::begin(), std::list< T >::end(), std::endl(), std::make_pair(), marlin::my_cout, std::list< T >::push_back(), and marlin::tMap.
|
static |
Return the instance of this manager.
Definition at line 60 of file ProcessorMgr.cc.
References _me, and ProcessorMgr().
Referenced by marlin::XMLFixCollTypes::parse(), marlin::Processor::Processor(), marlin::StdHepReader::readDataSource(), and marlin::Processor::setReturnValue().
|
virtual |
Definition at line 380 of file ProcessorMgr.cc.
References _conditions, _eventModifierList, _list, _skipMap, std::list< T >::begin(), marlin::LogicalExpressions::clear(), marlin::LogicalExpressions::conditionIsTrue(), std::list< T >::end(), marlin::end_t, marlin::Global::EVENTSEEDER, std::map< K, T >::find(), marlin::StringParameters::getStringVal(), marlin::my_cout, marlin::Global::parameters, marlin::ProcessorEventSeeder::refreshSeeds(), marlin::start_t, and marlin::tMap.
|
virtual |
Definition at line 364 of file ProcessorMgr.cc.
References _eventModifierList, std::list< T >::begin(), std::list< T >::end(), and marlin::my_cout.
|
virtual |
Definition at line 465 of file ProcessorMgr.cc.
References _conditions, _list, _skipMap, std::list< T >::begin(), marlin::LogicalExpressions::clear(), marlin::LogicalExpressions::conditionIsTrue(), std::list< T >::end(), marlin::end_t, marlin::Global::EVENTSEEDER, std::map< K, T >::find(), marlin::StringParameters::getStringVal(), marlin::my_cout, marlin::Global::parameters, marlin::ProcessorEventSeeder::refreshSeeds(), marlin::start_t, and marlin::tMap.
Referenced by marlin::StdHepReader::readDataSource().
|
virtual |
Definition at line 302 of file ProcessorMgr.cc.
References _list, std::list< T >::begin(), std::list< T >::end(), std::endl(), marlin::Global::GEAR, and marlin::my_cout.
Referenced by marlin::StdHepReader::readDataSource().
|
virtual |
Calls readDataSource() for all Processors of type DataSourceProcessor.
Definition at line 91 of file ProcessorMgr.cc.
References _list, std::list< T >::begin(), std::list< T >::end(), and marlin::DataSourceProcessor::readDataSource().
|
protected |
Register a processor with the given name.
Definition at line 73 of file ProcessorMgr.cc.
References _map, std::map< K, T >::end(), std::map< K, T >::find(), and marlin::Processor::type().
Referenced by marlin::Processor::Processor().
void marlin::ProcessorMgr::removeActiveProcessor | ( | const std::string & | name | ) |
Remove processor with name from list of active processors.
Definition at line 215 of file ProcessorMgr.cc.
References _activeMap, _list, std::map< K, T >::erase(), and std::list< T >::remove().
Set the return value for the given processor.
Definition at line 517 of file ProcessorMgr.cc.
References _conditions, marlin::Processor::name(), and marlin::LogicalExpressions::setValue().
Referenced by marlin::Processor::setReturnValue().
|
virtual |
Set the named return value for the given processor.
Definition at line 522 of file ProcessorMgr.cc.
References _conditions, marlin::Processor::name(), and marlin::LogicalExpressions::setValue().
|
friend |
Definition at line 39 of file ProcessorMgr.h.
|
friend |
Definition at line 40 of file ProcessorMgr.h.
|
friend |
Definition at line 38 of file ProcessorMgr.h.
|
private |
Definition at line 123 of file ProcessorMgr.h.
Referenced by addActiveProcessor(), end(), getActiveProcessor(), and removeActiveProcessor().
|
private |
Definition at line 129 of file ProcessorMgr.h.
Referenced by addActiveProcessor(), modifyEvent(), processEvent(), and setProcessorReturnValue().
|
private |
Definition at line 127 of file ProcessorMgr.h.
Referenced by init(), modifyEvent(), and modifyRunHeader().
|
private |
Definition at line 124 of file ProcessorMgr.h.
Referenced by addActiveProcessor(), end(), init(), modifyEvent(), processEvent(), processRunHeader(), readDataSource(), and removeActiveProcessor().
|
private |
Definition at line 122 of file ProcessorMgr.h.
Referenced by dumpRegisteredProcessors(), dumpRegisteredProcessorsXML(), end(), getAvailableProcessorTypes(), getProcessor(), and registerProcessor().
|
staticprivate |
Definition at line 121 of file ProcessorMgr.h.
Referenced by end(), and instance().
|
private |
Definition at line 125 of file ProcessorMgr.h.
Referenced by end(), modifyEvent(), and processEvent().