#include <ncbireg.hpp>
Inheritance diagram for IRegistry:


Base class for organized configuration data.
Does not define a specific in-memory representation, just a read-only API and some convenience methods.
Definition at line 75 of file ncbireg.hpp.
Public Types | |
| typedef int | TFlags |
| Binary OR of "EFlags". | |
| enum | EFlags { fTransient = 0x1, fPersistent = 0x100, fOverride = 0x2, fNoOverride = 0x200, fTruncate = 0x4, fNoTruncate = 0x400, fJustCore = 0x8, fNotJustCore = 0x800, fIgnoreErrors = 0x10, fInternalSpaces = 0x20, fWithNcbirc = 0x40, fCountCleared = 0x80, fSectionCase = 0x1000, fEntryCase = 0x2000, fCoreLayers = fTransient | fPersistent | fJustCore, fAllLayers = fTransient | fPersistent | fNotJustCore, fCaseFlags = fSectionCase | fEntryCase } |
| Flags controlling the behavior of registry methods. More... | |
| enum | EErrAction { eThrow, eErrPost, eReturn } |
| What to do if parameter value is present but cannot be converted into the requested type. More... | |
Public Member Functions | |
| bool | Empty (TFlags flags=fAllLayers) const |
| Verify if Registry is empty. | |
| bool | Modified (TFlags flags=fPersistent) const |
| Verify if persistent values have been modified. | |
| void | SetModifiedFlag (bool modified, TFlags flags=fPersistent) |
| Indicate whether any relevant values are out of sync with some external resource (typically a configuration file). | |
| bool | Write (CNcbiOstream &os, TFlags flags=0) const |
| Write the registry content to output stream. | |
| const string & | Get (const string §ion, const string &name, TFlags flags=0) const |
| Get the parameter value. | |
| bool | HasEntry (const string §ion, const string &name=kEmptyStr, TFlags flags=0) const |
| string | GetString (const string §ion, const string &name, const string &default_value, TFlags flags=0) const |
| Get the parameter string value. | |
| int | GetInt (const string §ion, const string &name, int default_value, TFlags flags=0, EErrAction err_action=eThrow) const |
| Get integer value of specified parameter name. | |
| bool | GetBool (const string §ion, const string &name, bool default_value, TFlags flags=0, EErrAction err_action=eThrow) const |
| Get boolean value of specified parameter name. | |
| double | GetDouble (const string §ion, const string &name, double default_value, TFlags flags=0, EErrAction err_action=eThrow) const |
| Get double value of specified parameter name. | |
| const string & | GetComment (const string §ion=kEmptyStr, const string &name=kEmptyStr, TFlags flags=0) const |
| Get comment of the registry entry "section:name". | |
| void | EnumerateSections (list< string > *sections, TFlags flags=fAllLayers) const |
| Enumerate section names. | |
| void | EnumerateEntries (const string §ion, list< string > *entries, TFlags flags=fAllLayers) const |
| Enumerate parameter names for a specified section. | |
| void | ReadLock (void) |
| Support for locking. | |
| void | WriteLock (void) |
| void | Unlock (void) |
Protected Types | |
| typedef void(IRegistry::* | FLockAction )(void) |
| enum | EMasks { fLayerFlags = fAllLayers | fJustCore, fTPFlags = fTransient | fPersistent } |
Protected Member Functions | |
| virtual bool | x_Empty (TFlags flags) const =0 |
| Implementations of the fundamental operations above, to be run with the lock already acquired and some basic sanity checks performed. | |
| virtual bool | x_Modified (TFlags) const |
| virtual void | x_SetModifiedFlag (bool, TFlags) |
| virtual const string & | x_Get (const string §ion, const string &name, TFlags flags) const =0 |
| virtual bool | x_HasEntry (const string §ion, const string &name, TFlags flags) const =0 |
| virtual const string & | x_GetComment (const string §ion, const string &name, TFlags flags) const =0 |
| virtual void | x_Enumerate (const string §ion, list< string > &entries, TFlags flags) const =0 |
| virtual void | x_ChildLockAction (FLockAction) |
Static Protected Member Functions | |
| static void | x_CheckFlags (const string &func, TFlags &flags, TFlags allowed) |
Private Attributes | |
| CRWLock | m_Lock |
|
|
Definition at line 297 of file ncbireg.hpp. |
|
|
Binary OR of "EFlags".
Definition at line 104 of file ncbireg.hpp. |
|
|
What to do if parameter value is present but cannot be converted into the requested type.
Definition at line 179 of file ncbireg.hpp. |
|
|
Flags controlling the behavior of registry methods. Please note:
Definition at line 85 of file ncbireg.hpp. |
|
|
Definition at line 274 of file ncbireg.hpp. |
|
|
Verify if Registry is empty.
Definition at line 152 of file ncbireg.cpp. References fLayerFlags, fTPFlags, x_CheckFlags(), and x_Empty(). Referenced by CPtbRegistry::CPtbRegistry(), CCompoundRWRegistry::x_Read(), and IRWRegistry::x_Read(). |
|
||||||||||||||||
|
Enumerate parameter names for a specified section. Write all parameter names for specified "section" to the "entries" list in order. Previous contents of the list are erased. Enumerates sections rather than entries if section is empty.
Definition at line 422 of file ncbireg.cpp. References _ASSERT, _TRACE, fCountCleared, fInternalSpaces, fLayerFlags, fTPFlags, NStr::PrintableString(), s_IsNameSection(), NStr::TruncateSpaces(), and x_CheckFlags(). Referenced by CDBUDPriorityMapper::ConfigureFromRegistry(), CDBUDRandomMapper::ConfigureFromRegistry(), CConfig::ConvertRegToTree(), CPluginManager< TClass >::CPluginManager(), CDriverManager::CreateDsFrom(), CRegistryFile::FromConfigFile(), GetDefaultLogLocation(), CCgiApplication::GetDefaultLogPath(), CColumnScoringMethod::Load(), CColorTableMethod::Load(), Write(), CNcbiTestApplication::x_ReadConfiguration(), and CGBenchApplication::x_TestGuiRegistry(). |
|
||||||||||||
|
Enumerate section names. Write all section names to the "sections" list in (case-insensitive) order. Previous contents of the list are erased.
Definition at line 408 of file ncbireg.cpp. References _ASSERT, fCountCleared, fInternalSpaces, fLayerFlags, fTPFlags, kEmptyStr, x_CheckFlags(), and x_Enumerate(). Referenced by CConfig::ConvertRegToTree(), CIdMapperConfig::DescribeContexts(), CRegistryFile::FromConfigFile(), Write(), CNetCacheServer::x_CreateStorages(), and CGBenchApplication::x_TestGuiRegistry(). |
|
||||||||||||||||
|
||||||||||||||||||||||||
|
Get boolean value of specified parameter name. Like "GetString()", plus convert the value into boolean.
Definition at line 327 of file ncbireg.cpp. References Get(). Referenced by BDB_CreateEnv(), CNCBlobStorage::CNCBlobStorage(), CQueueDataBase::Configure(), CGridWorkerNode::Init(), CGridCgiApplication::InitGridClient(), SQueueParameters::Read(), CGridWorkerNode::Run(), CCgiApplication::Run(), CLDSIndexerApplication::Run(), CBDBEnvKeeperApp::Run(), CNetworkOptionsPage::TransferDataToWindow(), CSampleLdsApplication::x_InitLDS(), and CNetCacheServer::x_RegReadBool(). |
|
||||||||||||||||
|
Get comment of the registry entry "section:name".
Definition at line 386 of file ncbireg.cpp. References _TRACE, fInternalSpaces, fLayerFlags, kEmptyStr, NStr::PrintableString(), s_IsNameSection(), NStr::TruncateSpaces(), and x_CheckFlags(). Referenced by Write(), and IRWRegistry::x_Read(). |
|
||||||||||||||||||||||||
|
Get double value of specified parameter name. Like "GetString()", plus convert the value into double.
Definition at line 356 of file ncbireg.cpp. References Get(). Referenced by CMatrixScoringMethod::Load(), and CColumnScoringMethod::Load(). |
|
||||||||||||||||||||||||
|
Get integer value of specified parameter name. Like "GetString()", plus convert the value into integer.
Definition at line 298 of file ncbireg.cpp. References Get(). Referenced by CCgiStatistics::Compose(), CDBConnectionFactory::ConfigureFromRegistry(), CSampleJob::CSampleJob(), CProjBulderApp::EnumOpt(), CGridCgiApplication::InitGridClient(), CRemoteAppParams::Load(), CGridWorkerNode::Run(), CBDBEnvKeeperApp::Run(), CNetworkOptionsPage::TransferDataToWindow(), CCgiApplication::x_AddLBCookie(), CCgiTunnel2Grid::x_Init(), CCgi2RCgiApp::x_Init(), and CNetCacheServer::x_RegReadInt(). |
|
||||||||||||||||||||
|
Get the parameter string value. Similar to the "Get()", but if the configuration parameter is not found, then return 'default_value' rather than empty string.
Definition at line 290 of file ncbireg.cpp. References Get(). Referenced by BDB_CreateEnv(), CDBUniversalMapper::ConfigureFromRegistry(), CDBUDPriorityMapper::ConfigureFromRegistry(), CDBUDRandomMapper::ConfigureFromRegistry(), CPluginManager< TClass >::CPluginManager(), CRemoteAppIdleTask::CRemoteAppIdleTask(), CSampleJob::CSampleJob(), CProjBulderApp::GetDatatoolCommandLine(), CProjBulderApp::GetDatatoolId(), CProjBulderApp::GetDatatoolPathForApp(), CProjBulderApp::GetDatatoolPathForLib(), GetDllsList(), GetHostedLibs(), CProjBulderApp::GetRegSettings(), CSeqTextDemoDlg::Init(), CColorTableMethod::Load(), CRemoteAppParams::Load(), LoadConfigInfoByNames(), CTemplateScoringMethod::LoadInfo(), CProjBulderApp::ProcessLocationMacros(), SQueueParameters::Read(), SNS_Parameters::Read(), CGridWorkerNode::Run(), CSplitCacheApp::SetupCache(), CCgiApplication::x_AddLBCookie(), CTemplateScoringMethod::x_GetColor(), CODBC_Connection::x_GetDriverName(), CCgiTunnel2Grid::x_Init(), CCgi2RCgiApp::x_Init(), CUIToolRegistry::x_ReadToolInfo(), and CNetCacheServer::x_RegReadString(). |
|
||||||||||||||||
|
Definition at line 265 of file ncbireg.cpp. References _TRACE, fCountCleared, fInternalSpaces, fLayerFlags, fTPFlags, NStr::PrintableString(), s_IsNameSection(), NStr::TruncateSpaces(), and x_CheckFlags(). Referenced by CCodeGenerator::GetOpt(), CNcbiRegistry::IncludeNcbircIfAllowed(), CMatrixScoringMethod::Load(), CColorTableMethod::Load(), CRemoteAppParams::Load(), oligofar::COligoFarApp::ParseConfig(), CGetOpt::ParseIni(), CRemoteAppDispatcher::ProcessRequest(), CGridWorkerNode::Run(), CMemoryRegistry::x_Enumerate(), and CCompoundRWRegistry::x_Set(). |
|
|
Verify if persistent values have been modified.
Definition at line 163 of file ncbireg.cpp. References fLayerFlags, fPersistent, fTransient, x_CheckFlags(), and x_Modified(). Referenced by Write(), and IRWRegistry::x_Read(). |
|
|
Support for locking. Individual operations already use these to ensure atomicity, but the locking mechanism is recursive, so users can also make entire sequences of operations atomic. Definition at line 443 of file ncbireg.cpp. References m_Lock, CRWLock::ReadLock(), and x_ChildLockAction(). |
|
||||||||||||
|
Indicate whether any relevant values are out of sync with some external resource (typically a configuration file). You should normally not need to call this explicitly.
Definition at line 174 of file ncbireg.cpp. References fLayerFlags, fPersistent, fTransient, x_CheckFlags(), and x_SetModifiedFlag(). Referenced by Write(). |
|
|
Definition at line 457 of file ncbireg.cpp. References m_Lock, CRWLock::Unlock(), and x_ChildLockAction(). |
|
||||||||||||
|
Write the registry content to output stream.
Definition at line 186 of file ncbireg.cpp. References Endl(), entries, EnumerateEntries(), EnumerateSections(), fCountCleared, fInternalSpaces, fJustCore, fLayerFlags, fNotJustCore, fPersistent, fTransient, Get(), GetComment(), ITERATE, kEmptyStr, Modified(), Printable(), s_WriteComment(), SetModifiedFlag(), and x_CheckFlags(). Referenced by SaveRegistry(), CRegistryFile::ToConfigFile(), CNCMessageHandler::x_DoCmd_GetConfig(), and CGBenchApplication::x_SaveConfig(). |
|
|
Definition at line 450 of file ncbireg.cpp. References m_Lock, CRWLock::WriteLock(), and x_ChildLockAction(). |
|
||||||||||||||||
|
Referenced by IRWRegistry::Clear(), CNcbiRegistry::CNcbiRegistry(), Empty(), EnumerateEntries(), EnumerateSections(), Get(), GetComment(), HasEntry(), Modified(), IRWRegistry::Read(), IRWRegistry::Set(), IRWRegistry::SetComment(), SetModifiedFlag(), and Write(). |
|
|
Definition at line 298 of file ncbireg.hpp. Referenced by ReadLock(), Unlock(), and WriteLock(). |
|
|
Implementations of the fundamental operations above, to be run with the lock already acquired and some basic sanity checks performed.
Referenced by IRWRegistry::Clear(), and Empty(). |
|
||||||||||||||||
|
Referenced by EnumerateSections(). |
|
||||||||||||||||
|
Referenced by Get(). |
|
||||||||||||||||
|
|
|
||||||||||||||||
|
|
|
|
Definition at line 284 of file ncbireg.hpp. Referenced by Modified(). |
|
||||||||||||
|
Definition at line 285 of file ncbireg.hpp. Referenced by IRWRegistry::Clear(), IRWRegistry::Set(), and SetModifiedFlag(). |
|
|
Definition at line 301 of file ncbireg.hpp. Referenced by ReadLock(), Unlock(), and WriteLock(). |
1.4.6
Modified on Mon Dec 07 16:24:26 2009 by modify_doxy.py rev. 173732