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

#include <Controller.hpp>

Inheritance diagram for cafe::Controller:

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

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.

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


Constructor & Destructor Documentation

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

Definition at line 18 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(), cafe::IfPr::IfPr(), and cafe::Permute::Permute().

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

Definition at line 38 of file Controller.cpp.

References add().

cafe::Controller::~Controller  ) 
 

Definition at line 45 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 187 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 177 of file Controller.cpp.

References add().

bool cafe::Controller::add Processor proc  ) 
 

Add Processor object directly to Controller.

Definition at line 162 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 182 of file Controller.cpp.

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

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

Called at beginning of processing.

Reimplemented from cafe::Processor.

Definition at line 55 of file Controller.cpp.

References _outfile, _processors, 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 99 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 129 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 120 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::IfPr, cafe::OR, cafe::Permute, and cafe::Timer.

Definition at line 138 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 151 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::OR::processEvent(), cafe::IfPr::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::IfPr::IfPr(), cafe::OR::processEvent(), cafe::IfPr::processEvent(), 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::IfPr::IfPr(), cafe::OR::processEvent(), cafe::IfPr::processEvent(), cafe::If::processEvent(), cafe::Fork::processEvent(), and processEvent().


The documentation for this class was generated from the following files:
Generated on Thu Apr 3 04:14:27 2008 for CAF by doxygen 1.3.4