NCBI C++ ToolKit
Public Types | Public Member Functions | Static Public Attributes | Protected Member Functions | Private Types | Private Attributes | List of all members
CCompoundRWRegistry Class Reference

Search Toolkit Book for CCompoundRWRegistry

CCompoundRWRegistry –. More...

#include <corelib/ncbireg.hpp>

+ Inheritance diagram for CCompoundRWRegistry:
+ Collaboration diagram for CCompoundRWRegistry:

Public Types

enum  EPriority { ePriority_MinUser = CCompoundRegistry::ePriority_Min , ePriority_Default = CCompoundRegistry::ePriority_Default , ePriority_MaxUser = CCompoundRegistry::ePriority_Max - 0x10000 , ePriority_Reserved }
 Priority for sub-registries; entries in higher-priority sub-registries take precedence over (identically named) entries in lower-priority ones. More...
 
typedef int TPriority
 Not restricted to ePriority_*. More...
 
- Public Types inherited from IRWRegistry
enum  EOperation { eClear , eRead , eSet }
 Categories of modifying operations. More...
 
- Public Types inherited from IRegistry
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 , fSectionlessEntries = 0x4000 , fSections = 0x8000 ,
  fPlaintextAllowed = 0x10000 , fInSectionComments = 0x20000 , fInternalCheckedAndLocked = 0x40000 , 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...
 
typedef int TFlags
 Binary OR of "EFlags". More...
 
- Public Types inherited from CObject
enum  EAllocFillMode { eAllocFillNone = 1 , eAllocFillZero , eAllocFillPattern }
 Control filling of newly allocated memory. More...
 
typedef CObjectCounterLocker TLockerType
 Default locker type for CRef. More...
 
typedef atomic< Uint8TCounter
 Counter type is CAtomiCounter. More...
 
typedef Uint8 TCount
 Alias for value type of counter. More...
 

Public Member Functions

 CCompoundRWRegistry (TFlags m_Flags=0)
 Constructor. More...
 
 ~CCompoundRWRegistry ()
 Destructor. More...
 
TPriority GetCoreCutoff (void) const
 Subregistries whose priority is less than the core cutoff (ePriority_Reserved by default) will be ignored for fJustCore operations, such as Write by default. More...
 
void SetCoreCutoff (TPriority prio)
 
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. More...
 
void Remove (const IRegistry &reg)
 Remove sub-registry "reg". More...
 
CConstRef< IRegistryFindByName (const string &name) const
 Return a pointer to the sub-registry with the given name, or NULL if not found. More...
 
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. More...
 
bool LoadBaseRegistries (TFlags flags=0, int metareg_flags=0, const string &path=kEmptyStr)
 Load any base registries listed in [NCBI].Inherits; returns true if able to load at least one, false otherwise. More...
 
- Public Member Functions inherited from IRWRegistry
void Clear (TFlags flags=fAllLayers)
 Reset the registry content. More...
 
IRWRegistryRead (CNcbiIstream &is, TFlags flags=0, const string &path=kEmptyStr)
 Read and parse the stream "is", and merge its content with current Registry entries. More...
 
bool Set (const string &section, const string &name, const string &value, TFlags flags=0, const string &comment=kEmptyStr)
 Set the configuration parameter value. More...
 
bool Unset (const string &section, const string &name, TFlags flags=0)
 Fully unset the configuration parameter value, so that HasEntry returns false. More...
 
bool SetComment (const string &comment, const string &section=kEmptyStr, const string &name=kEmptyStr, TFlags flags=0)
 Set comment "comment" for the registry entry "section:name". More...
 
bool SetValue (const string &section, const string &name, const string &value, TFlags flags=0, const string &comment=kEmptyStr)
 Overloading of setters for generic programming. More...
 
bool SetValue (const string &section, const string &name, int value, TFlags flags=0, const string &comment=kEmptyStr)
 
bool SetValue (const string &section, const string &name, bool value, TFlags flags=0, const string &comment=kEmptyStr)
 
bool SetValue (const string &section, const string &name, double value, TFlags flags=0, const string &comment=kEmptyStr)
 
- Public Member Functions inherited from IRegistry
bool Empty (TFlags flags=fAllLayers) const
 Verify if Registry is empty. More...
 
bool Modified (TFlags flags=fPersistent) const
 Verify if persistent values have been modified. More...
 
void SetModifiedFlag (bool modified, TFlags flags=fPersistent)
 Indicate whether any relevant values are out of sync with some external resource (typically a configuration file). More...
 
bool Write (CNcbiOstream &os, TFlags flags=0) const
 Write the registry content to output stream. More...
 
virtual const stringGet (const string &section, const string &name, TFlags flags=0) const
 Get the parameter value. More...
 
virtual bool HasEntry (const string &section, const string &name=kEmptyStr, TFlags flags=0) const
 
virtual string GetString (const string &section, const string &name, const string &default_value, TFlags flags=0) const
 Get the parameter string value. More...
 
string GetEncryptedString (const string &section, const string &name, TFlags flags=0, const string &password=kEmptyStr) const
 Get a value that was (potentially) stored encrypted. More...
 
virtual int GetInt (const string &section, const string &name, int default_value, TFlags flags=0, EErrAction err_action=eThrow) const
 Get integer value of specified parameter name. More...
 
virtual bool GetBool (const string &section, const string &name, bool default_value, TFlags flags=0, EErrAction err_action=eThrow) const
 Get boolean value of specified parameter name. More...
 
virtual double GetDouble (const string &section, const string &name, double default_value, TFlags flags=0, EErrAction err_action=eThrow) const
 Get double value of specified parameter name. More...
 
virtual const stringGetComment (const string &section=kEmptyStr, const string &name=kEmptyStr, TFlags flags=0) const
 Get comment of the registry entry "section:name". More...
 
virtual void EnumerateInSectionComments (const string &section, list< string > *comments, TFlags flags=fAllLayers) const
 Enumerate in-section comments. More...
 
virtual void EnumerateSections (list< string > *sections, TFlags flags=fAllLayers) const
 Enumerate section names. More...
 
virtual void EnumerateEntries (const string &section, list< string > *entries, TFlags flags=fAllLayers) const
 Enumerate parameter names for a specified section. More...
 
void ReadLock (void)
 Support for locking. More...
 
void WriteLock (void)
 
void Unlock (void)
 
string GetValue (const string &section, const string &name, const string &default_value, EErrAction=eReturn, TFlags flags=0) const
 Overloading of getters for generic programming. More...
 
int GetValue (const string &section, const string &name, int default_value, EErrAction err_action=eErrPost, TFlags flags=0) const
 
bool GetValue (const string &section, const string &name, bool default_value, EErrAction err_action=eErrPost, TFlags flags=0) const
 
double GetValue (const string &section, const string &name, double default_value, EErrAction err_action=eErrPost, TFlags flags=0) const
 
- Public Member Functions inherited from CObject
 CObject (void)
 Constructor. More...
 
 CObject (const CObject &src)
 Copy constructor. More...
 
virtual ~CObject (void)
 Destructor. More...
 
CObjectoperator= (const CObject &src) THROWS_NONE
 Assignment operator. More...
 
bool CanBeDeleted (void) const THROWS_NONE
 Check if object can be deleted. More...
 
bool IsAllocatedInPool (void) const THROWS_NONE
 Check if object is allocated in memory pool (not system heap) More...
 
bool Referenced (void) const THROWS_NONE
 Check if object is referenced. More...
 
bool ReferencedOnlyOnce (void) const THROWS_NONE
 Check if object is referenced only once. More...
 
void AddReference (void) const
 Add reference to object. More...
 
void RemoveReference (void) const
 Remove reference to object. More...
 
void ReleaseReference (void) const
 Remove reference without deleting object. More...
 
virtual void DoNotDeleteThisObject (void)
 Mark this object as not allocated in heap – do not delete this object. More...
 
virtual void DoDeleteThisObject (void)
 Mark this object as allocated in heap – object can be deleted. More...
 
void * operator new (size_t size)
 Define new operator for memory allocation. More...
 
void * operator new[] (size_t size)
 Define new[] operator for 'array' memory allocation. More...
 
void operator delete (void *ptr)
 Define delete operator for memory deallocation. More...
 
void operator delete[] (void *ptr)
 Define delete[] operator for memory deallocation. More...
 
void * operator new (size_t size, void *place)
 Define new operator. More...
 
void operator delete (void *ptr, void *place)
 Define delete operator. More...
 
void * operator new (size_t size, CObjectMemoryPool *place)
 Define new operator using memory pool. More...
 
void operator delete (void *ptr, CObjectMemoryPool *place)
 Define delete operator. More...
 
virtual void DebugDump (CDebugDumpContext ddc, unsigned int depth) const
 Define method for dumping debug information. More...
 
- Public Member Functions inherited from CDebugDumpable
 CDebugDumpable (void)
 
virtual ~CDebugDumpable (void)
 
void DebugDumpText (ostream &out, const string &bundle, unsigned int depth) const
 
void DebugDumpFormat (CDebugDumpFormatter &ddf, const string &bundle, unsigned int depth) const
 
void DumpToConsole (void) const
 

Static Public Attributes

static const char * sm_MainRegName = ".main"
 Predefined subregistry's name. More...
 
static const char * sm_BaseRegNamePrefix = ".base:"
 Prefix for any base registries' names. More...
 
- Static Public Attributes inherited from IRegistry
static const char * sm_InSectionCommentName = "[]"
 Entry name for an in-section comment. More...
 
- Static Public Attributes inherited from CObject
static const TCount eCounterBitsCanBeDeleted = 1 << 0
 Define possible object states. More...
 
static const TCount eCounterBitsInPlainHeap = 1 << 1
 Heap signature was found. More...
 
static const TCount eCounterBitsPlaceMask
 Mask for 'in heap' state flags. More...
 
static const int eCounterStep = 1 << 2
 Skip over the "in heap" bits. More...
 
static const TCount eCounterValid = TCount(1) << (sizeof(TCount) * 8 - 2)
 Minimal value for valid objects (reference counter is zero) Must be a single bit value. More...
 
static const TCount eCounterStateMask
 Valid object, and object in heap. More...
 

Protected Member Functions

bool x_Empty (TFlags flags) const
 Implementations of the fundamental operations above, to be run with the lock already acquired and some basic sanity checks performed. More...
 
bool x_Modified (TFlags flags) const
 
void x_SetModifiedFlag (bool modified, TFlags flags)
 
const stringx_Get (const string &section, const string &name, TFlags flags) const
 
bool x_HasEntry (const string &section, const string &name, TFlags flags) const
 
const stringx_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)
 
void x_Clear (TFlags flags)
 Called locked, like the virtual methods inherited from IRegistry. More...
 
bool x_Set (const string &section, const string &name, const string &value, TFlags flags, const string &comment)
 
bool x_Unset (const string &section, const string &name, TFlags flags)
 
bool x_SetComment (const string &comment, const string &section, const string &name, TFlags flags)
 
IRWRegistryx_Read (CNcbiIstream &is, TFlags flags, const string &path)
 Most implementations should not override this, but CNcbiRegistry must, to handle some special cases properly. More...
 
void x_Add (const IRegistry &reg, TPriority prio=ePriority_Default, const string &name=kEmptyStr)
 Add an internal high-priority subregistry. More...
 
- Protected Member Functions inherited from CObject
virtual void DeleteThis (void)
 Virtual method "deleting" this object. More...
 

Private Types

typedef map< string, TFlagsTClearedEntries
 

Private Attributes

TClearedEntries m_ClearedEntries
 
CRef< CTwoLayerRegistrym_MainRegistry
 
CRef< CCompoundRegistrym_AllRegistries
 
set< stringm_BaseRegNames
 
TFlags m_Flags
 

Additional Inherited Members

- Static Public Member Functions inherited from IRWRegistry
static TFlags AssessImpact (TFlags flags, EOperation op)
 Indicate which portions of the registry the given operation would affect. More...
 
- Static Public Member Functions inherited from IRegistry
static bool IsNameSection (const string &str, TFlags flags)
 Check if "str" consists of alphanumeric and '_' only Treat the case of set fSectionlessEntries separately. More...
 
static bool IsNameEntry (const string &str, TFlags flags)
 
- Static Public Member Functions inherited from CObject
static NCBI_XNCBI_EXPORT void ThrowNullPointerException (void)
 Define method to throw null pointer exception. More...
 
static NCBI_XNCBI_EXPORT void ThrowNullPointerException (const type_info &type)
 
static EAllocFillMode GetAllocFillMode (void)
 
static void SetAllocFillMode (EAllocFillMode mode)
 
static void SetAllocFillMode (const string &value)
 Set mode from configuration parameter value. More...
 
- Static Public Member Functions inherited from CDebugDumpable
static void EnableDebugDump (bool on)
 
- Protected Types inherited from IRegistry
enum  EMasks { fLayerFlags = fAllLayers | fJustCore , fTPFlags = fTransient | fPersistent }
 
typedef void(IRegistry::* FLockAction) (void)
 
- Static Protected Member Functions inherited from IRWRegistry
static bool MaybeSet (string &target, const string &value, TFlags flags)
 
- Static Protected Member Functions inherited from IRegistry
static void x_CheckFlags (const string &func, TFlags &flags, TFlags allowed)
 

Detailed Description

CCompoundRWRegistry –.

Writeable compound registry.

Compound registry whose top layer is a two-layer registry; all writes go to the two-layer registry.

Definition at line 795 of file ncbireg.hpp.


The documentation for this class was generated from the following files:
Modified on Sat May 11 13:55:25 2024 by modify_doxy.py rev. 669887