ALox  V. 2402 R. 0
Home ALox for C++ ALox for C# ALox for Java Download
Inner Classes | Public Static Fields | Public Fields | Public Methods | Protected Fields | Protected Methods | List of all members
Domain Class Reference
Collaboration diagram for Domain:
[legend]

Class Description


Objects of this class represent a Log Domain of ALox. This class is internally used by class Lox.

Inner Classes

class  LoggerData
 
class  PL
 

Public Static Fields

static readonly char Separator ='/'
 

Public Fields

int CntLogCalls =0
 
bool ConfigurationRead =false
 
List< LoggerDataData
 
AString FullPath
 
AString Name
 
Domain Parent
 
List< PLPrefixLogables = new List<PL>()
 
List< DomainSubDomains
 

Public Methods

 Domain (Domain parent, AString name)
 
int AddLogger (Logger logger)
 
int CountLoggers ()
 
Domain Find (AString domainPathAS, int maxCreate, ref bool wasCreated)
 
int GetCount (int loggerNo)
 
Logger GetLogger (int no)
 
Logger GetLogger (String loggerName)
 
int GetLoggerNo (Logger logger)
 
int GetLoggerNo (String loggerName)
 
int GetPriority (int loggerNo)
 
Domain GetRoot ()
 
Verbosity GetVerbosity (int loggerNo)
 
bool IsActive (int loggerNo, Verbosity statement)
 
void RemoveLogger (int loggerNo)
 
Verbosity SetVerbosity (int loggerNo, Verbosity verbosity, int priority)
 
override String ToString ()
 

Protected Fields

AString tAString =new AString()
 
Substring tSubstring = new Substring()
 
Substring tSubstring2 = new Substring()
 

Protected Methods

void addLoggerRecursive (Logger logger)
 
Domain findRecursive (Substring domainPath, int maxCreate, ref bool wasCreated)
 
void removeLoggerRecursive (int loggerNo)
 

Constructor & Destructor Documentation

◆ Domain()

Domain ( Domain  parent,
AString  name 
)
inline

Constructor for domain.

Parameters
parentThe parent domain. For root domains, this is null.
nameThe name of the domain. For root domains, this is null.

Member Function Documentation

◆ AddLogger()

int AddLogger ( Logger  logger)
inline

Adds a new entry in field Data and recursively demands the same from its sub-domains. Checks if a logger with the same name exists.

Parameters
loggerThe logger to add.
Returns
The number of the Logger, -1 if a logger with the same name exists already.

◆ addLoggerRecursive()

void addLoggerRecursive ( Logger  logger)
inlineprotected

Internal, recursive helper of AddLogger.

Parameters
loggerThe logger to add.

◆ CountLoggers()

int CountLoggers ( )
inline

Returns the number of loggers stored in this domain (the same for all domains within a tree).

Returns
The number of loggers attached.

◆ Find()

Domain Find ( AString  domainPathAS,
int  maxCreate,
ref bool  wasCreated 
)
inline

Searches a domain. If not found, the domain is (or path of domains are) created in the domain tree. If the path string starts with the character defined in Separator, then the search (and creation) is done starting from the root domain of this domain and not from this domain.

Parameters
domainPathASPath and domain to search.
maxCreateThe maximum number of sub domains that are created if not found at the end of the path.
[out]wasCreatedOutput parameter that is set true if domain was not found and hence created.
Returns
The domain found or created.

◆ findRecursive()

Domain findRecursive ( Substring  domainPath,
int  maxCreate,
ref bool  wasCreated 
)
inlineprotected

Internal, recursive helper of Find.

Parameters
domainPathPath to search.
maxCreateThe maximum number of sub domains that are created if not found at the end of the path.
[out]wasCreatedOutput parameter that is set true if domain was not found and hence created.
Returns
The domain found or created.

◆ GetCount()

int GetCount ( int  loggerNo)
inline

Returns the number of log calls for this domain and logger.

Parameters
loggerNoThe number of the Logger whose Verbosity is requested.
Returns
The number of calls executed by this logger on this domain.

◆ GetLogger() [1/2]

Logger GetLogger ( int  no)
inline

Returns logger of given number.

Parameters
noThe number of the Logger to return.
Returns
The Logger found with number no.

◆ GetLogger() [2/2]

Logger GetLogger ( String  loggerName)
inline

Searches and returns the Logger given by name.

Parameters
loggerNameThe logger to search.
Returns
The Logger found corresponding to given name. If the Logger does not exist, null is returned.

◆ GetLoggerNo() [1/2]

int GetLoggerNo ( Logger  logger)
inline

Returns the number of a Logger.

Parameters
loggerThe logger to search.
Returns
The number of the Logger. If the Logger does not exist, -1 is returned.

◆ GetLoggerNo() [2/2]

int GetLoggerNo ( String  loggerName)
inline

Returns the number of the Logger specified by name.

Parameters
loggerNameThe logger name to search.
Returns
The number of the Logger found corresponding to given name. If the Logger does not exist, -1 is returned.

◆ GetPriority()

int GetPriority ( int  loggerNo)
inline

Returns the priority of the Verbosity setting for the given logger number.

Parameters
loggerNoThe number of the Logger whose Verbosity is requested.
Returns
The priority.

◆ GetRoot()

Domain GetRoot ( )
inline

Returns the root domain of this object.

Returns
The root domain of this object

◆ GetVerbosity()

Verbosity GetVerbosity ( int  loggerNo)
inline

Returns the Log Domain's Verbosity for the given logger number.

Parameters
loggerNoThe number of the Logger whose Verbosity is requested.
Returns
The found/defined domain Verbosity.

◆ IsActive()

bool IsActive ( int  loggerNo,
Verbosity  statement 
)
inline

Determines if the domain is active in respect to the given Verbosity.

Parameters
loggerNoThe number of the Logger whose Verbosity is to be evaluated against level.
statementThe Verbosity to check.
Returns
true if domain is active (log should be performed)

◆ RemoveLogger()

void RemoveLogger ( int  loggerNo)
inline

Removes an new entry in field Data and recursively demands the same from its sub-domains.

Parameters
loggerNoThe number of the Logger to be removed

◆ removeLoggerRecursive()

void removeLoggerRecursive ( int  loggerNo)
inlineprotected

Internal, recursive helper of RemoveLogger.

Parameters
loggerNoThe number of the Logger to be removed.

◆ SetVerbosity()

Verbosity SetVerbosity ( int  loggerNo,
Verbosity  verbosity,
int  priority 
)
inline

Sets the verbosity for a logger of this domain of all its sub domains to the specified value. If given priority is lower than those actually stored, nothing is set and recursion is stopped.

Parameters
loggerNoThe number of the Logger to set the Verbosity for.
verbosityThe verbosity value to set.
priorityThe priority of the setting.
Returns
The new Verbosity.

◆ ToString()

override String ToString ( )
inline

This is for debugging purposes and for configuration output. E.g. this enables the Monodevelop IDE to display object descriptions in the debugger.

Returns
A human readable string representation of this object.

Member Data Documentation

◆ CntLogCalls

int CntLogCalls =0

A counter for the quantity of calls on this domain. The does not include:

  • logs when no Logger was set
  • conditional logs that were suppressed Otherwise, it includes all log calls, even when no Logger was enabled on this domain.

◆ ConfigurationRead

bool ConfigurationRead =false

Flag to which is set when verbosity configuration data was read.

◆ Data

List<LoggerData> Data

Data stored per logger. The index is corresponding to the list of loggers in 'our' Lox.

◆ FullPath

AString FullPath

The full path of the domain (set in the constructor once) .

◆ Name

AString Name

The name of the domain. For root domains, this is null.

◆ Parent

Domain Parent

The parent domain. For root domains, this is null.

◆ PrefixLogables

List<PL> PrefixLogables = new List<PL>()

Prefix Logables associated with this domain.

◆ Separator

readonly char Separator ='/'
static

Domain separation character

◆ SubDomains

List<Domain> SubDomains

A list of sub domains.

◆ tAString

AString tAString =new AString()
protected

A reusable AString .

◆ tSubstring

Substring tSubstring = new Substring()
protected

A reusable substring .

◆ tSubstring2

Substring tSubstring2 = new Substring()
protected

A reusable substring .


The documentation for this class was generated from the following file: