CCompoundRegistry Class Reference
[Application Registry]

Search Toolkit Book for CCompoundRegistry

#include <ncbireg.hpp>

Inheritance diagram for CCompoundRegistry:

Inheritance graph
[legend]
Collaboration diagram for CCompoundRegistry:

Collaboration graph
[legend]
List of all members.

Detailed Description

CCompoundRegistry --.

Prioritized read-only collection of sub-registries.

See also:
CTwoLayerRegistry

Definition at line 510 of file ncbireg.hpp.

Public Types

typedef int TPriority
 Not restricted to ePriority_*.
enum  EPriority { ePriority_Min = kMin_Int, ePriority_Default = 0, ePriority_Max = kMax_Int }
 Priority for sub-registries; entries in higher-priority sub-registries take precedence over (identically named) entries in lower-priority ones. More...

Public Member Functions

 CCompoundRegistry ()
void Add (const IRegistry &reg, TPriority prio=ePriority_Default, const string &name=kEmptyStr)
 Non-empty names must be unique within each compound registry, but there is no limit to the number of anonymous sub-registries.
void Remove (const IRegistry &reg)
 Remove sub-registry "reg".
TPriority GetCoreCutoff (void) const
 Subregistries whose priority is less than the core cutoff (ePriority_Default by default) will be ignored for fJustCore operations, such as Write by default.
void SetCoreCutoff (TPriority prio)
CConstRef< IRegistryFindByName (const string &name) const
 Return a pointer to the sub-registry with the given name, or NULL if not found.
CConstRef< IRegistryFindByContents (const string &section, const string &entry=kEmptyStr, TFlags flags=0) const
 Return a pointer to the highest-priority sub-registry with a section named SECTION containing (if ENTRY is non-empty) an entry named ENTRY, or NULL if not found.

Protected Member Functions

bool x_Empty (TFlags flags) const
 True iff all sub-registries are empty.
bool x_Modified (TFlags flags) const
 True iff any sub-registry is modified.
void x_SetModifiedFlag (bool modified, TFlags flags)
const string & x_Get (const string &section, const string &name, TFlags flags) const
bool x_HasEntry (const string &section, const string &name, TFlags flags) const
const string & x_GetComment (const string &section, const string &name, TFlags flags) const
void x_Enumerate (const string &section, list< string > &entries, TFlags flags) const
void x_ChildLockAction (FLockAction action)

Private Types

typedef multimap< TPriority,
CRef< IRegistry > > 
TPriorityMap
typedef map< string, CRef<
IRegistry > > 
TNameMap

Private Attributes

TPriorityMap m_PriorityMap
TNameMap m_NameMap
 excludes anonymous sub-registries
TPriority m_CoreCutoff

Friends

class CCompoundRWRegistry


Member Typedef Documentation

typedef map<string, CRef<IRegistry> > CCompoundRegistry::TNameMap [private]
 

Definition at line 581 of file ncbireg.hpp.

typedef int CCompoundRegistry::TPriority
 

Not restricted to ePriority_*.

Definition at line 528 of file ncbireg.hpp.

typedef multimap<TPriority, CRef<IRegistry> > CCompoundRegistry::TPriorityMap [private]
 

Definition at line 580 of file ncbireg.hpp.


Member Enumeration Documentation

enum CCompoundRegistry::EPriority
 

Priority for sub-registries; entries in higher-priority sub-registries take precedence over (identically named) entries in lower-priority ones.

Ties are broken arbitrarily.

Enumerator:
ePriority_Min 
ePriority_Default 
ePriority_Max 

Definition at line 523 of file ncbireg.hpp.


Constructor & Destructor Documentation

CCompoundRegistry::CCompoundRegistry  )  [inline]
 

Definition at line 513 of file ncbireg.hpp.


Member Function Documentation

void CCompoundRegistry::Add const IRegistry reg,
TPriority  prio = ePriority_Default,
const string &  name = kEmptyStr
 

Non-empty names must be unique within each compound registry, but there is no limit to the number of anonymous sub-registries.

Sub-registries themselves may not (directly) appear more than once.

Definition at line 976 of file ncbireg.cpp.

References multimap_checker< Container >::insert(), m_NameMap, m_PriorityMap, and NCBI_THROW2.

CConstRef< IRegistry > CCompoundRegistry::FindByContents const string &  section,
const string &  entry = kEmptyStr,
TFlags  flags = 0
const
 

Return a pointer to the highest-priority sub-registry with a section named SECTION containing (if ENTRY is non-empty) an entry named ENTRY, or NULL if not found.

Definition at line 1025 of file ncbireg.cpp.

References IRegistry::fJustCore, m_PriorityMap, and REVERSE_ITERATE.

Referenced by x_Get(), and x_HasEntry().

CConstRef< IRegistry > CCompoundRegistry::FindByName const string &  name  )  const
 

Return a pointer to the sub-registry with the given name, or NULL if not found.

Definition at line 1018 of file ncbireg.cpp.

References map_checker< Container >::end(), map_checker< Container >::find(), and m_NameMap.

TPriority CCompoundRegistry::GetCoreCutoff void   )  const [inline]
 

Subregistries whose priority is less than the core cutoff (ePriority_Default by default) will be ignored for fJustCore operations, such as Write by default.

Definition at line 544 of file ncbireg.hpp.

References m_CoreCutoff.

void CCompoundRegistry::Remove const IRegistry reg  ) 
 

Remove sub-registry "reg".

Throw an exception if "reg" is not a (direct) sub-registry.

Definition at line 997 of file ncbireg.cpp.

References multimap_checker< Container >::erase(), map_checker< Container >::erase(), m_NameMap, m_PriorityMap, NCBI_THROW2, and NON_CONST_ITERATE.

void CCompoundRegistry::SetCoreCutoff TPriority  prio  )  [inline]
 

Definition at line 545 of file ncbireg.hpp.

References m_CoreCutoff.

void CCompoundRegistry::x_ChildLockAction FLockAction  action  )  [protected]
 

Definition at line 1136 of file ncbireg.cpp.

References m_PriorityMap, and NON_CONST_ITERATE.

bool CCompoundRegistry::x_Empty TFlags  flags  )  const [protected]
 

True iff all sub-registries are empty.

Definition at line 1039 of file ncbireg.cpp.

References IRegistry::fJustCore, m_CoreCutoff, m_PriorityMap, and REVERSE_ITERATE.

void CCompoundRegistry::x_Enumerate const string &  section,
list< string > &  entries,
TFlags  flags
const [protected]
 

Definition at line 1116 of file ncbireg.cpp.

References IRegistry::fJustCore, set< Key, Compare >::insert(), ITERATE, m_CoreCutoff, m_PriorityMap, and REVERSE_ITERATE.

const string & CCompoundRegistry::x_Get const string &  section,
const string &  name,
TFlags  flags
const [protected]
 

Definition at line 1080 of file ncbireg.cpp.

References FindByContents(), IRegistry::fJustCore, and kEmptyStr.

const string & CCompoundRegistry::x_GetComment const string &  section,
const string &  name,
TFlags  flags
const [protected]
 

Definition at line 1097 of file ncbireg.cpp.

References multimap_checker< Container >::empty(), kEmptyStr, and m_PriorityMap.

bool CCompoundRegistry::x_HasEntry const string &  section,
const string &  name,
TFlags  flags
const [protected]
 

Definition at line 1090 of file ncbireg.cpp.

References FindByContents().

bool CCompoundRegistry::x_Modified TFlags  flags  )  const [protected]
 

True iff any sub-registry is modified.

Definition at line 1053 of file ncbireg.cpp.

References IRegistry::fJustCore, m_CoreCutoff, m_PriorityMap, and REVERSE_ITERATE.

void CCompoundRegistry::x_SetModifiedFlag bool  modified,
TFlags  flags
[protected]
 

Definition at line 1067 of file ncbireg.cpp.

References _ASSERT, IRegistry::fJustCore, m_CoreCutoff, and m_PriorityMap.


Friends And Related Function Documentation

friend class CCompoundRWRegistry [friend]
 

Definition at line 587 of file ncbireg.hpp.


Member Data Documentation

TPriority CCompoundRegistry::m_CoreCutoff [private]
 

Definition at line 585 of file ncbireg.hpp.

Referenced by GetCoreCutoff(), SetCoreCutoff(), x_Empty(), x_Enumerate(), x_Modified(), and x_SetModifiedFlag().

TNameMap CCompoundRegistry::m_NameMap [private]
 

excludes anonymous sub-registries

Definition at line 584 of file ncbireg.hpp.

Referenced by Add(), FindByName(), and Remove().

TPriorityMap CCompoundRegistry::m_PriorityMap [private]
 

Definition at line 583 of file ncbireg.hpp.

Referenced by Add(), FindByContents(), Remove(), x_ChildLockAction(), x_Empty(), x_Enumerate(), x_GetComment(), x_Modified(), and x_SetModifiedFlag().


The documentation for this class was generated from the following files:
Generated on Mon Dec 7 10:51:36 2009 for NCBI C++ ToolKit by  doxygen 1.4.6
Modified on Mon Dec 07 16:22:52 2009 by modify_doxy.py rev. 173732