Marlin  01.17.01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Attributes | Static Private Attributes | Friends | List of all members
marlin::ProcessorMgr Class Reference

Processor manager singleton class. More...

#include <ProcessorMgr.h>

+ Inheritance diagram for marlin::ProcessorMgr:

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...
 
ProcessorgetActiveProcessor (const std::string &name)
 Return the active processor with the given name. More...
 
ProcessorgetProcessor (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 ProcessorMgrinstance ()
 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::stringgetAvailableProcessorTypes ()
 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
 

Detailed Description

Processor manager singleton class.

Holds references to all registered Processors.

Responsible for creating the instance of ProcessorEventSeeder and setting the Global::EVENTSEEDER variable.

Author
F. Gaede, DESY
Version
Id:
ProcessorMgr.h,v 1.16 2007-08-13 10:38:39 gaede Exp

Definition at line 36 of file ProcessorMgr.h.

Constructor & Destructor Documentation

marlin::ProcessorMgr::~ProcessorMgr ( )
virtual

destructor deletes ProcessorEventSeeder

Definition at line 70 of file ProcessorMgr.cc.

marlin::ProcessorMgr::ProcessorMgr ( )
protected

Definition at line 48 of file ProcessorMgr.cc.

References std::endl(), marlin::Global::EVENTSEEDER, and std::stringstream::str().

Referenced by instance().

Member Function Documentation

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().

void marlin::ProcessorMgr::end ( )
virtual
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.

std::set< std::string > marlin::ProcessorMgr::getAvailableProcessorTypes ( )
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().

void marlin::ProcessorMgr::init ( )
virtual
ProcessorMgr * marlin::ProcessorMgr::instance ( )
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().

void marlin::ProcessorMgr::modifyEvent ( LCEvent *  evt)
virtual
void marlin::ProcessorMgr::modifyRunHeader ( LCRunHeader *  rhd)
virtual
void marlin::ProcessorMgr::processEvent ( LCEvent *  evt)
virtual
void marlin::ProcessorMgr::processRunHeader ( LCRunHeader *  run)
virtual
void marlin::ProcessorMgr::readDataSource ( int  numEvents)
virtual
void marlin::ProcessorMgr::registerProcessor ( Processor processor)
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().

void marlin::ProcessorMgr::setProcessorReturnValue ( Processor proc,
bool  val 
)
virtual

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().

void marlin::ProcessorMgr::setProcessorReturnValue ( Processor proc,
bool  val,
const std::string name 
)
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().

Friends And Related Function Documentation

friend class CMProcessor
friend

Definition at line 39 of file ProcessorMgr.h.

friend class MarlinSteerCheck
friend

Definition at line 40 of file ProcessorMgr.h.

friend class Processor
friend

Definition at line 38 of file ProcessorMgr.h.

Member Data Documentation

ProcessorMap marlin::ProcessorMgr::_activeMap {}
private

Definition at line 123 of file ProcessorMgr.h.

Referenced by addActiveProcessor(), end(), getActiveProcessor(), and removeActiveProcessor().

LogicalExpressions marlin::ProcessorMgr::_conditions {}
private
ProcessorList marlin::ProcessorMgr::_eventModifierList {}
private

Definition at line 127 of file ProcessorMgr.h.

Referenced by init(), modifyEvent(), and modifyRunHeader().

ProcessorList marlin::ProcessorMgr::_list {}
private
ProcessorMap marlin::ProcessorMgr::_map {}
private
ProcessorMgr * marlin::ProcessorMgr::_me = 0
staticprivate

Definition at line 121 of file ProcessorMgr.h.

Referenced by end(), and instance().

SkippedEventMap marlin::ProcessorMgr::_skipMap {}
private

Definition at line 125 of file ProcessorMgr.h.

Referenced by end(), modifyEvent(), and processEvent().


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