CfgConfigurable Class Reference

#include <CfgConfigurable.h>

Inheritance diagram for CfgConfigurable:
BfldLoanPool Conf DbiTableProxyRegistry DigiStep< TInputList, TOutputList > 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]

====================================================================== 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]
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.

References fDefConfig.

Referenced by Set().

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.

References fConfig.

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.

References fConfig.

Referenced by apply_reg_gui(), UgliGeometry::BuildNodes(), GeoMediumMap::BuildSwimMethodMap(), PlexLoanPool::Config(), DbiTableProxyRegistry::Config(), UgliLoanPool::Config(), Conf::Config(), BfldLoanPool::Config(), HepevtModule::Get(), RerootToTruthModule::Get(), UgliLoanPool::GetAlwaysUseDbi(), UgliLoanPool::GetLeadStacks(), UgliLoanPool::GetMedium(), UgliLoanPool::GetMediumRegistry(), UgliLoanPool::GetMinervaVersion(), GfxStripListCfg::GetScaleIs(), GfxDigitListCfg::GetScaleIs(), GfxDigitListCfg::GetShapeIs(), GfxStripListCfg::GetShapeIs(), UgliLoanPool::GetShieldOff(), GfxStripListCfg::GetSizeBy(), GfxDigitListCfg::GetSizeBy(), GfxDigitListCfg::GetSizeFactor(), GfxStripListCfg::GetSizeFactor(), GfxDigitListCfg::GetSizeIs(), GfxStripListCfg::GetSizeIs(), GfxDigitListCfg::GetStripEnd(), GfxStripListCfg::GetStripEnd(), UgliLoanPool::GetSwimMethodHighField(), UgliLoanPool::GetSwimMethodLowField(), UgliLoanPool::GetUseNewCavern(), GfxDigitListCfg::GfxDigitListCfg(), GfxStripListCfg::GfxStripListCfg(), GfxCfg::GuiConfig(), BfldLoanPool::Instance(), UgliLoanPool::Instance(), Plexus::Plexus(), BfldLoanPool::Print(), PlexLoanPool::Print(), UgliLoanPool::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(), 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 DefaultConfig(), GetConfig(), Registry::LockValues(), Registry::Merge(), CfgDialog::Query(), CfgDialog::SetCurrent(), CfgDialog::SetDefault(), and Registry::UnLockValues().

Referenced by far_cosmic_mc_configure(), far_mc_configure(), HepevtModule::Get(), RerootToTruthModule::Get(), main(), near_mc_configure(), set_sm2_bfield(), UgliLoanPool::SetAlwaysUseDbi(), UgliLoanPool::SetConfigFromEnvironment(), DbiTableProxyRegistry::SetConfigFromEnvironment(), PlexLoanPool::SetConfigFromEnvironment(), BfldLoanPool::SetConfigFromEnvironment(), 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 (  ) 

====================================================================== 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(), HepevtModule::Get(), RerootToTruthModule::Get(), BfldLoanPool::Instance(), UgliLoanPool::Instance(), main(), 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

Definition at line 81 of file CfgConfigurable.h.

Referenced by GetConfig(), and Update().

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 22 May 2017 for loon by  doxygen 1.6.1