#include <CfgConfigBuilder.h>
Inheritance diagram for CfgConfigBuilder:

Public Member Functions | |
| CfgConfigBuilder () | |
| virtual | ~CfgConfigBuilder () |
Protected Member Functions | |
| void | Publish (CfgConfig *cfg) |
| Base class methods for CfgConfig creation. | |
Definition at line 21 of file CfgConfigBuilder.h.
| CfgConfigBuilder::CfgConfigBuilder | ( | ) | [inline] |
| virtual CfgConfigBuilder::~CfgConfigBuilder | ( | ) | [inline, virtual] |
| void CfgConfigBuilder::Publish | ( | CfgConfig * | cfg | ) | [protected] |
Base class methods for CfgConfig creation.
Definition at line 15 of file CfgConfigBuilder.cxx.
References CfgTable::AdoptConfig(), CfgConfig::GetName(), CfgTable::GetObservers(), CfgConfig::GetVersion(), CfgTable::Instance(), CfgException::Print(), and CfgConfig::SetReadOnly().
Referenced by CfgXMLconfigBuilder::Build(), TestBuilder::BuildCfg1(), and TestBuilder::BuildCfg2().
00016 { 00017 //====================================================================== 00018 // Publish the configuration cfg so that it is visible to the rest of 00019 // the program. Note that responsibility for the deletion of cfg is 00020 // transferred to the CfgTable class via this call. *Do not* delete a 00021 // configuration once you publish it!! 00022 //====================================================================== 00023 CfgTable& t = CfgTable::Instance(); 00024 00025 // Set read/write permissions based on policy 00026 cfg->SetReadOnly(-1); // -1 = determine from policy 00027 00028 // Insert the configuration into the table of configurations 00029 t.AdoptConfig(cfg); 00030 00031 // Alert observers of this configuration to the change it its 00032 // state 00033 CfgTable::ObsList olist; 00034 t.GetObservers(cfg->GetName(), cfg->GetVersion(), olist); 00035 00036 CfgTable::ObsList::iterator itr(olist.begin()); 00037 CfgTable::ObsList::iterator itrEnd(olist.end()); 00038 for (; itr!=itrEnd; ++itr) try { (*itr)->Update(*cfg); } 00039 catch (CfgException e) { 00040 std::cout << cfg->GetName() << "." << cfg->GetVersion() << " "; 00041 e.Print(); 00042 exit(-1); 00043 } 00044 }
1.4.7