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

CfgConfigurable Class Reference

#include <CfgConfigurable.h>

Inheritance diagram for CfgConfigurable:

BfldLoanPool Conf DbiTableProxyRegistry DigiStep< TInputList, > GfxCfg GfxCfg PlexLoanPool UgliLoanPool List of all members.

Public Member Functions

 CfgConfigurable ()
virtual ~CfgConfigurable ()
virtual void Config ()=0
virtual const RegistryDefaultConfig () const
RegistryGetConfig ()
const RegistryGetConfig () const
int Update ()
void Set (CfgDialog *d=0)
void Set (const char *s)

Protected Member Functions

virtual void CommitDefaultConfig (const Registry &r)

Private Attributes

Registry fDefConfig
Registry fConfig

Constructor & Destructor Documentation

CfgConfigurable::CfgConfigurable  ) 
 

Definition at line 16 of file CfgConfigurable.cxx.

00016 : fConfig(false) { }

CfgConfigurable::~CfgConfigurable  )  [virtual]
 

Definition at line 20 of file CfgConfigurable.cxx.

00020 { }


Member Function Documentation

void CfgConfigurable::CommitDefaultConfig const Registry r  )  [protected, virtual]
 

====================================================================== Subclass must call this before the Configurable can have meaningful entries ======================================================================

Definition at line 24 of file CfgConfigurable.cxx.

References fDefConfig.

Referenced by Conf::Conf(), GfxDigitListCfg::GfxDigitListCfg(), GfxMCVecListCfg::GfxMCVecListCfg(), GfxShowerListCfg::GfxShowerListCfg(), GfxStripListCfg::GfxStripListCfg(), and GfxTrackListCfg::GfxTrackListCfg().

00025 {
00030   fDefConfig = r;
00031 }

virtual void CfgConfigurable::Config  )  [pure virtual]
 

Implemented in BfldLoanPool, Conf, DbiTableProxyRegistry, GfxCfg, GfxCfg, PlexLoanPool, and UgliLoanPool.

Referenced by Update().

const Registry & CfgConfigurable::DefaultConfig void   )  const [virtual]
 

====================================================================== Eventually this might go in the database and load the configuration. This would take a name or something. ======================================================================

Reimplemented in BfldLoanPool, PlexLoanPool, and UgliLoanPool.

Definition at line 35 of file CfgConfigurable.cxx.

00036 {
00041   return fDefConfig;
00042 }

const Registry & CfgConfigurable::GetConfig  )  const
 

====================================================================== Returns the configuration Registry. This const version denies the user any freedom to modify it, but does mean that a configurable object can use it in a const method. ======================================================================

Definition at line 53 of file CfgConfigurable.cxx.

00054 {
00060   return fConfig;
00061 }

Registry & CfgConfigurable::GetConfig  ) 
 

====================================================================== Returns the configuration Registry, this is non-const as the user is user is free to modify ======================================================================

Definition at line 44 of file CfgConfigurable.cxx.

Referenced by apply_reg_gui(), UgliGeometry::BuildNodes(), GeoMediumMap::BuildSwimMethodMap(), UgliLoanPool::Config(), Conf::Config(), PlexLoanPool::Config(), DbiTableProxyRegistry::Config(), BfldLoanPool::Config(), RerootToTruthModule::Get(), UgliLoanPool::GetAlwaysUseDbi(), UgliLoanPool::GetMedium(), UgliLoanPool::GetMediumRegistry(), GfxStripListCfg::GetScaleIs(), GfxDigitListCfg::GetScaleIs(), GfxStripListCfg::GetShapeIs(), GfxDigitListCfg::GetShapeIs(), UgliLoanPool::GetShieldOff(), GfxStripListCfg::GetSizeBy(), GfxDigitListCfg::GetSizeBy(), GfxStripListCfg::GetSizeFactor(), GfxDigitListCfg::GetSizeFactor(), GfxStripListCfg::GetSizeIs(), GfxDigitListCfg::GetSizeIs(), GfxStripListCfg::GetStripEnd(), GfxDigitListCfg::GetStripEnd(), UgliLoanPool::GetSwimMethodHighField(), UgliLoanPool::GetSwimMethodLowField(), UgliLoanPool::GetUseNewCavern(), GfxDigitListCfg::GfxDigitListCfg(), GfxStripListCfg::GfxStripListCfg(), UgliLoanPool::Instance(), BfldLoanPool::Instance(), Plexus::Plexus(), UgliLoanPool::Print(), PlexLoanPool::Print(), BfldLoanPool::Print(), UgliLoanPool::PurgeDbiTableCache(), PlexLoanPool::PurgeDbiTableCache(), UgliLoanPool::ReadFromFile(), PlexLoanPool::ReadFromFile(), Set(), UgliLoanPool::SetCut(), UgliLoanPool::SetMedium(), UgliLoanPool::SetProcess(), UgliLoanPool::SetTracking(), testConf(), DbiTableProxyRegistry::~DbiTableProxyRegistry(), PlexLoanPool::~PlexLoanPool(), and UgliLoanPool::~UgliLoanPool().

00045 {
00050   return fConfig;
00051 }

void CfgConfigurable::Set const char *  s  ) 
 

====================================================================== Update the configuration given a text string s. Format: "key1=true, key2=10, key3=11.1, key4='A string'" ======================================================================

Definition at line 109 of file CfgConfigurable.cxx.

References GetConfig(), Registry::LockValues(), Registry::Merge(), s(), Cfg::StringToRegistry(), and Registry::UnLockValues().

00110 {
00115   Registry r;
00116   Cfg::StringToRegistry(r,s);
00117   this->GetConfig().UnLockValues();
00118   this->GetConfig().Merge(r);
00119   this->GetConfig().LockValues();
00120 }

void CfgConfigurable::Set CfgDialog d = 0  ) 
 

Definition at line 80 of file CfgConfigurable.cxx.

References GetConfig(), Registry::LockValues(), Registry::Merge(), CfgDialog::Query(), CfgDialog::SetCurrent(), CfgDialog::SetDefault(), and Registry::UnLockValues().

Referenced by far_cosmic_mc_configure(), far_mc_configure(), RerootToTruthModule::Get(), near_mc_configure(), set_sm2_bfield(), UgliLoanPool::SetAlwaysUseDbi(), UgliLoanPool::SetConfigFromEnvironment(), PlexLoanPool::SetConfigFromEnvironment(), DbiTableProxyRegistry::SetConfigFromEnvironment(), BfldLoanPool::SetConfigFromEnvironment(), UgliLoanPool::SetShieldOff(), UgliLoanPool::SetSwimMethodHighField(), UgliLoanPool::SetSwimMethodLowField(), UgliLoanPool::SetUseGeo(), and UgliLoanPool::SetUseNewCavern().

00081 {
00082 //======================================================================
00083 // Update the configuration parameters. Allow a CfgDialog object to be
00084 // passed in. If none is passed in use the default, text based dialog
00085 // object.
00086 //======================================================================
00087   bool deleteDialog = false;
00088   if (d==0) {
00089     d = new CfgDialog();
00090     deleteDialog = true;
00091   }
00092 
00093   // Set up d with the default configuration parameters
00094   d->SetDefault(this->DefaultConfig());
00095   d->SetCurrent(this->GetConfig());
00096   
00097   // Do the querry
00098   Registry r = d->Query();
00099   this->GetConfig().UnLockValues();
00100   this->GetConfig().Merge(r);
00101   this->GetConfig().LockValues();
00102 
00103   // Clean up the dialog
00104   if (deleteDialog) { delete d; d = 0; }
00105 }

int CfgConfigurable::Update  ) 
 

====================================================================== Update the class's state given the current configuration. If there is nothing to do just return w/o taking any action. Return's 0 if no action was taken, >0 if the object was reconfigured. ======================================================================

Definition at line 65 of file CfgConfigurable.cxx.

References Config(), fConfig, Registry::IsDirty(), and Registry::SetDirty().

Referenced by apply_reg_gui(), far_cosmic_mc_configure(), far_mc_configure(), RerootToTruthModule::Get(), UgliLoanPool::Instance(), BfldLoanPool::Instance(), near_mc_configure(), set_sm2_bfield(), DbiTableProxyRegistry::SetConfigFromEnvironment(), and testConf().

00066 {
00072   if (! fConfig.IsDirty()) return 0;  // Nothing to do if config is current
00073   this->Config();               // Send the "reconfig" message
00074   fConfig.SetDirty(false);      // Mark the config. as current
00075   return 1;
00076 }


Member Data Documentation

Registry CfgConfigurable::fConfig [private]
 

Definition at line 81 of file CfgConfigurable.h.

Referenced by Update().

Registry CfgConfigurable::fDefConfig [private]
 

Definition at line 81 of file CfgConfigurable.h.

Referenced by CommitDefaultConfig().


The documentation for this class was generated from the following files:
Generated on Mon Feb 15 11:08:59 2010 for loon by  doxygen 1.3.9.1