Main Page | Modules | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members

cafe::Controller Class Reference
[CAF Environment (Cafe)]

Common base class for Controllers, i.e. More...

#include <Controller.hpp>

Inheritance diagram for cafe::Controller:

cafe::Processor cafe::EventMultiSplitter cafe::Fork cafe::If cafe::Permute cafe::RunController cafe::Selector cafe::Timer List of all members.

Public Member Functions

 Controller (const char *name)
 Controller (const char *name, const std::list< cafe::Processor * > &procs)
 ~Controller ()
virtual void setDebug (unsigned int level)
 Set the debug level. Usually done by controller.

bool add (const std::string &name, const std::string &instance="")
 Add the named Processor to this Controller.

bool add (Processor *proc)
 Add Processor object directly to Controller.

bool add (bool(*func)(Event &), const std::string &instance)
 Add function directly to Controller.

 ClassDef (Controller, 0)
Processor interface
Calls the corresponding method for every child.

virtual void begin ()
 Called at beginning of processing.

virtual void finish ()
 Called at end of processing.

virtual void inputFileOpened (TFile *file)
 Called for every new input file that was opened.

virtual void inputFileClosing (TFile *file)
 Called for every input file that is about to be closed.

virtual bool processEvent (Event &event)
 Called for every event.


Protected Member Functions

bool add (const std::list< Processor * > &procs)
 Only used by subclasses: set the list of children.


Protected Attributes

std::list< Processor * > _processors
std::vector< std::string > _untag
std::vector< std::string > _tag

Private Attributes

TFile * _outfile

Detailed Description

Common base class for Controllers, i.e.

Processors that have children. This is intended as an internal base class. As a user prefer 'Group' instead.

Configuration options:

Definition at line 39 of file Controller.hpp.


Constructor & Destructor Documentation

cafe::Controller::Controller const char *  name  ) 
 

Definition at line 17 of file Controller.cpp.

References _tag, _untag, add(), cafe::Config::get(), cafe::Config::getVString(), cafe::Processor::name(), and cafe::ParseRun::parse().

Referenced by cafe::If::If(), and cafe::Permute::Permute().

cafe::Controller::Controller const char *  name,
const std::list< cafe::Processor * > &  procs
 

Definition at line 37 of file Controller.cpp.

References add().

cafe::Controller::~Controller  ) 
 

Definition at line 44 of file Controller.cpp.

References _processors.


Member Function Documentation

bool cafe::Controller::add const std::list< Processor * > &  procs  )  [protected]
 

Only used by subclasses: set the list of children.

Definition at line 182 of file Controller.cpp.

References add().

bool cafe::Controller::add bool(*  func)(Event &),
const std::string &  instance
 

Add function directly to Controller.

Definition at line 172 of file Controller.cpp.

References add().

bool cafe::Controller::add Processor proc  ) 
 

Add Processor object directly to Controller.

Definition at line 157 of file Controller.cpp.

References _processors, cafe::Processor::debug(), cafe::Processor::fullName(), cafe::Processor::name(), cafe::Processor::out(), cafe::Processor::setDebug(), and cafe::Processor::setParent().

bool cafe::Controller::add const std::string &  name,
const std::string &  instance = ""
 

Add the named Processor to this Controller.

Definition at line 177 of file Controller.cpp.

Referenced by add(), Controller(), cafe::If::If(), and cafe::Permute::Permute().

void cafe::Controller::begin  )  [virtual]
 

Called at beginning of processing.

Reimplemented from cafe::Processor.

Definition at line 54 of file Controller.cpp.

References _outfile, _processors, cafe::Processor::err(), cafe::Config::get(), cafe::Processor::getDirectory(), cafe::Processor::name(), cafe::Processor::out(), and cafe::Processor::setDirectory().

Referenced by cafe::Selector::Begin(), and cafe::RunController::Run().

cafe::Controller::ClassDef Controller  ,
 

void cafe::Controller::finish  )  [virtual]
 

Called at end of processing.

Reimplemented from cafe::Processor.

Reimplemented in cafe::EventMultiSplitter.

Definition at line 94 of file Controller.cpp.

References _outfile, _processors, cafe::Processor::name(), and cafe::Processor::out().

Referenced by cafe::RunController::Run(), and cafe::Selector::Terminate().

void cafe::Controller::inputFileClosing TFile *  file  )  [virtual]
 

Called for every input file that is about to be closed.

Reimplemented from cafe::Processor.

Definition at line 124 of file Controller.cpp.

References _processors.

Referenced by cafe::RunController::Run().

void cafe::Controller::inputFileOpened TFile *  file  )  [virtual]
 

Called for every new input file that was opened.

Reimplemented from cafe::Processor.

Reimplemented in cafe::If.

Definition at line 115 of file Controller.cpp.

References _processors.

Referenced by cafe::Selector::Init(), and cafe::RunController::Run().

bool cafe::Controller::processEvent Event event  )  [virtual]
 

Called for every event.

Reimplemented from cafe::Processor.

Reimplemented in cafe::EventMultiSplitter, cafe::Fork, cafe::If, cafe::Permute, and cafe::Timer.

Definition at line 133 of file Controller.cpp.

References _processors, _tag, _untag, cafe::EventBase::tag(), and cafe::EventBase::untag().

Referenced by cafe::Selector::Process(), and cafe::RunController::processTree().

void cafe::Controller::setDebug unsigned int  level  )  [virtual]
 

Set the debug level. Usually done by controller.

Reimplemented from cafe::Processor.

Definition at line 146 of file Controller.cpp.

References _processors.


Member Data Documentation

TFile* cafe::Controller::_outfile [private]
 

Definition at line 76 of file Controller.hpp.

Referenced by begin(), and finish().

std::list<Processor*> cafe::Controller::_processors [protected]
 

Definition at line 71 of file Controller.hpp.

Referenced by add(), begin(), finish(), inputFileClosing(), inputFileOpened(), cafe::Permute::processEvent(), cafe::If::processEvent(), cafe::Fork::processEvent(), processEvent(), setDebug(), and ~Controller().

std::vector<std::string> cafe::Controller::_tag [protected]
 

Definition at line 73 of file Controller.hpp.

Referenced by Controller(), cafe::If::processEvent(), cafe::Fork::processEvent(), and processEvent().

std::vector<std::string> cafe::Controller::_untag [protected]
 

Definition at line 72 of file Controller.hpp.

Referenced by Controller(), cafe::If::processEvent(), cafe::Fork::processEvent(), and processEvent().


The documentation for this class was generated from the following files:
Generated on Tue Mar 28 10:13:10 2006 for CAF by doxygen 1.3.4