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

Search Toolkit Book for IRegistry

IRegistry –. More...

#include <corelib/ncbireg.hpp>

+ Inheritance diagram for IRegistry:
+ Collaboration diagram for IRegistry:

Public Types

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

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 Member Functions

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)
 

Static Public Attributes

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 Types

enum  EMasks { fLayerFlags = fAllLayers | fJustCore , fTPFlags = fTransient | fPersistent }
 
typedef void(IRegistry::* FLockAction) (void)
 

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. More...
 
virtual bool x_Modified (TFlags) const
 
virtual void x_SetModifiedFlag (bool, TFlags)
 
virtual const stringx_Get (const string &section, const string &name, TFlags flags) const =0
 
virtual bool x_HasEntry (const string &section, const string &name, TFlags flags) const =0
 
virtual const stringx_GetComment (const string &section, const string &name, TFlags flags) const =0
 
virtual void x_Enumerate (const string &section, list< string > &entries, TFlags flags) const =0
 
virtual void x_ChildLockAction (FLockAction)
 
- Protected Member Functions inherited from CObject
virtual void DeleteThis (void)
 Virtual method "deleting" this object. More...
 

Static Protected Member Functions

static void x_CheckFlags (const string &func, TFlags &flags, TFlags allowed)
 

Private Attributes

CRWLock m_Lock
 

Detailed Description

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 72 of file ncbireg.hpp.


The documentation for this class was generated from the following files:
Modified on Fri Sep 20 14:58:30 2024 by modify_doxy.py rev. 669887