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

Detailed Description

Definition at line 51 of file CfgConfigurable.h.


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]

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 (  )  const [virtual]

Reimplemented in BfldLoanPool, PlexLoanPool, and UgliLoanPool.

Definition at line 35 of file CfgConfigurable.cxx.

References fDefConfig.

00036 {
00041   return fDefConfig;
00042 }

const Registry & CfgConfigurable::GetConfig (  )  const

Definition at line 53 of file CfgConfigurable.cxx.

References fConfig.

00054 {
00060   return fConfig;
00061 }

Registry & CfgConfigurable::GetConfig (  ) 

Definition at line 44 of file CfgConfigurable.cxx.

References fConfig.

Referenced by apply_reg_gui(), UgliGeometry::BuildNodes(), GeoMediumMap::BuildSwimMethodMap(), UgliLoanPool::Config(), Conf::Config(), PlexLoanPool::Config(), DbiTableProxyRegistry::Config(), BfldLoanPool::Config(), RerootToTruthModule::Get(), HepevtModule::Get(), UgliLoanPool::GetAlwaysUseDbi(), UgliLoanPool::GetLeadStacks(), UgliLoanPool::GetMedium(), UgliLoanPool::GetMediumRegistry(), UgliLoanPool::GetMinervaVersion(), UgliLoanPool::GetShieldOff(), 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(), PlexLoanPool::~PlexLoanPool(), and UgliLoanPool::~UgliLoanPool().

00045 {
00050   return fConfig;
00051 }

void CfgConfigurable::Set ( const char *  s  ) 

Definition at line 109 of file CfgConfigurable.cxx.

References GetConfig(), Registry::LockValues(), Registry::Merge(), 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(), HepevtModule::Get(), near_mc_configure(), set_sm2_bfield(), UgliLoanPool::SetAlwaysUseDbi(), UgliLoanPool::SetLeadStacks(), UgliLoanPool::SetMinervaVersion(), 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 (  ) 

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(), HepevtModule::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 GetConfig(), and Update().

Registry CfgConfigurable::fDefConfig [private]

Definition at line 81 of file CfgConfigurable.h.

Referenced by CommitDefaultConfig(), and DefaultConfig().


The documentation for this class was generated from the following files:
Generated on Thu Apr 10 23:02:25 2014 for loon by  doxygen 1.4.7