Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

cfg::Observer Class Reference

Defines the base class for classes which use cfg::Config parameters. More...

#include <Observer.h>

Inheritance diagram for cfg::Observer:

DetectorViewOption jobc::Module PlaneViewOption TestObs TestObserver WindowOptions calhit::CalHit cluster::Clusterer demo::Module mcchk::GenCheck ModuleA ModuleB novamc::NOVAMC photrans::SimpleTransport RICHReco rpr::FindTrackSeg rpr::TrackReco rsim::ReadoutSim spider::SpiderWeb subshower::RecoSubShower2D subshower::RecoSubShower3D TPCdEdx TPCPass1 TPCPass2 List of all members.

Public Member Functions

virtual ~Observer ()
 Defines the interface for cfg::Config clients.

virtual void Update (const cfg::Config &c)=0
void RemoveWatch (const char *config)
void RemoveAllWatches ()
void SetWatch (const char *config, const char *version="default")

Detailed Description

Defines the base class for classes which use cfg::Config parameters.

Definition at line 14 of file Observer.h.


Constructor & Destructor Documentation

cfg::Observer::~Observer  )  [virtual]
 

Defines the interface for cfg::Config clients.

Definition at line 15 of file Observer.cxx.

References RemoveAllWatches().

00015 { this->RemoveAllWatches(); }


Member Function Documentation

void cfg::Observer::RemoveAllWatches  ) 
 

Definition at line 29 of file Observer.cxx.

References cfg::Table::Instance(), and cfg::Table::RemoveAllWatches().

Referenced by cluster::Clusterer::~Clusterer(), ~Observer(), rsim::ReadoutSim::~ReadoutSim(), and spider::SpiderWeb::~SpiderWeb().

00030 {
00031 //======================================================================
00032 // Remove all watches set by this observer
00033 //======================================================================
00034   cfg::Table::Instance().RemoveAllWatches(this);
00035 }

void cfg::Observer::RemoveWatch const char *  config  ) 
 

Definition at line 19 of file Observer.cxx.

References cfg::Table::Instance(), and cfg::Table::RemoveWatch().

Referenced by jobc::Module::SetCfgVersion().

00020 {
00021 //======================================================================
00022 // Remove this observer from the list of clients of config
00023 //======================================================================
00024   cfg::Table::Instance().RemoveWatch(config,this);
00025 }

void cfg::Observer::SetWatch const char *  config,
const char *  version = "default"
 

Definition at line 39 of file Observer.cxx.

References cfg::Table::GetConfig(), cfg::Table::Instance(), cfg::Table::SetWatch(), and Update().

Referenced by cluster::Clusterer::Clusterer(), DetectorViewOption::DetectorViewOption(), main(), PlaneViewOption::PlaneViewOption(), rsim::ReadoutSim::ReadoutSim(), jobc::Module::SetCfgVersion(), spider::SpiderWeb::SpiderWeb(), TestObs::TestObs(), TestObserver::TestObserver(), and WindowOptions::WindowOptions().

00040 {
00041 //======================================================================
00042 // Set a watch for the named version of the configuration config
00043 //======================================================================
00044   // Set the new watch
00045   cfg::Table::Instance().SetWatch(config, version, this);
00046 
00047   // Trigger the first update
00048   cfg::Config* c = cfg::Table::Instance().GetConfig(config, version);
00049   if (c) try { this->Update(*c); }
00050   catch (cfg::Exception e) { 
00051     std::cout << " *-> " << config << "." << version << " ";
00052     e.Print(); 
00053     exit(-1);
00054   }
00055 }

virtual void cfg::Observer::Update const cfg::Config c  )  [pure virtual]
 

Implemented in calhit::CalHit, cluster::Clusterer, demo::Module, DetectorViewOption, PlaneViewOption, WindowOptions, mcchk::GenCheck, novamc::NOVAMC, photrans::SimpleTransport, rsim::ReadoutSim, rpr::FindTrackSeg, rpr::TrackReco, subshower::RecoSubShower2D, subshower::RecoSubShower3D, spider::SpiderWeb, TestObserver, TestObs, RICHReco, ModuleA, ModuleB, TPCdEdx, TPCPass1, and TPCPass2.

Referenced by SetWatch().


The documentation for this class was generated from the following files:
Generated on Thu Jul 24 12:01:15 2008 for NOvA Offline by doxygen 1.3.5