ALib C++ Library
Library Version: 2510 R0
Documentation generated by doxygen
Loading...
Searching...
No Matches
alib::lox::detail::Domain Class Reference

Description:

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

Definition at line 50 of file domain.inl.

Collaboration diagram for alib::lox::detail::Domain:
[legend]

Inner Type Index:

struct  LoggerData
 Internal class that holds data stored per Logger. More...
 

Public Static Method Index:

static constexpr nchar Separator ()
 

Public Field Index:

integer CntLogCalls =0
 
bool ConfigurationAlreadyRead =false
 Flag which is set when verbosity configuration data was read.
 
StdVectorMono< LoggerDataData
 
NString FullPath
 The full path of the domain (set in the constructor once) .
 
NString Name
 The name of the domain. For root domains, this is nulled.
 
DomainParent
 The parent domain. For root domains, this is nullptr.
 
List< PoolAllocator, std::pair< PrefixLogable *, lang::Inclusion >, Recycling::None > PrefixLogables
 Prefix Logables associated with this domain.
 
List< MonoAllocator, Domain, Recycling::None > SubDomains
 A list of subdomains, sorted by name.
 

Public Method Index:

ALIB_DLL Domain (Domain *parent, const NString &name)
 
ALIB_DLL Domain (MonoAllocator &allocator, PoolAllocator &pool, const NString &name)
 
int AddLogger (detail::Logger *logger)
 
int CountLoggers ()
 
ALIB_DLL DomainFind (NSubstring domainPath, int maxCreate, bool *wasCreated)
 
int GetCount (int loggerNo)
 
detail::LoggerGetLogger (const NString &loggerName)
 
detail::LoggerGetLogger (int no)
 
int GetLoggerNo (const NString &loggerName)
 
int GetLoggerNo (detail::Logger *logger)
 
Priority GetPriority (int loggerNo)
 
DomainGetRoot ()
 
Verbosity GetVerbosity (int loggerNo)
 
bool IsActive (int loggerNo, Verbosity statement)
 
void RemoveLogger (int loggerNo)
 
ALIB_DLL Verbosity SetVerbosity (int loggerNo, Verbosity verbosity, Priority priority)
 
void ToString (NAString &target)
 

Protected Method Index:

ALIB_DLL void addLoggerRecursive (detail::Logger *logger)
 
DomainfindRecursive (NSubstring &domainPath, int maxCreate, bool *wasCreated)
 
ALIB_DLL void removeLoggerRecursive (int loggerNo)
 

Field Details:

◆ CntLogCalls

integer alib::lox::detail::Domain::CntLogCalls =0

A counter for the quantity of calls on this domain. Counting 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.

Definition at line 111 of file domain.inl.

◆ ConfigurationAlreadyRead

bool alib::lox::detail::Domain::ConfigurationAlreadyRead =false

Flag which is set when verbosity configuration data was read.

Definition at line 114 of file domain.inl.

◆ Data

StdVectorMono<LoggerData> alib::lox::detail::Domain::Data

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

Definition at line 98 of file domain.inl.

◆ FullPath

NString alib::lox::detail::Domain::FullPath

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

Definition at line 87 of file domain.inl.

◆ Name

NString alib::lox::detail::Domain::Name

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

Definition at line 84 of file domain.inl.

◆ Parent

Domain* alib::lox::detail::Domain::Parent

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

Definition at line 90 of file domain.inl.

◆ PrefixLogables

List< PoolAllocator, std::pair<PrefixLogable*, lang::Inclusion>, Recycling::None> alib::lox::detail::Domain::PrefixLogables

Prefix Logables associated with this domain.

Definition at line 104 of file domain.inl.

◆ SubDomains

List< MonoAllocator, Domain, Recycling::None> alib::lox::detail::Domain::SubDomains

A list of subdomains, sorted by name.

Definition at line 94 of file domain.inl.

Constructor(s) / Destructor Details:

◆ Domain() [1/2]

alib::lox::detail::Domain::Domain ( MonoAllocator & allocator,
PoolAllocator & pool,
const NString & name )

Constructor used for the root domain.

Parameters
allocatorThe monotonic allocator used allocation of permanent objects.
poolThe pool allocator used allocation of non-permanent objects.
nameThe name of this root domains

Definition at line 56 of file domain.cpp.

Here is the call graph for this function:

◆ Domain() [2/2]

alib::lox::detail::Domain::Domain ( Domain * parent,
const NString & name )

Constructor

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

Definition at line 73 of file domain.cpp.

Here is the call graph for this function:

Method Details:

◆ AddLogger()

int alib::lox::detail::Domain::AddLogger ( detail::Logger * logger)
inline

Adds a new entry in field Data and recursively demands the same from its Subdomains. 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.

Definition at line 155 of file domain.inl.

Here is the call graph for this function:

◆ addLoggerRecursive()

void alib::lox::detail::Domain::addLoggerRecursive ( detail::Logger * logger)
protected

Internal, recursive helper of AddLogger.

Parameters
loggerThe logger to add.

Definition at line 238 of file domain.cpp.

Here is the call graph for this function:

◆ CountLoggers()

int alib::lox::detail::Domain::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.

Definition at line 189 of file domain.inl.

◆ Find()

Domain * alib::lox::detail::Domain::Find ( NSubstring domainPath,
int maxCreate,
bool * wasCreated )

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 with Separator, then the search (and creation) is done starting from the root domain of this domain and not from this domain.

Parameters
domainPathPath and domain to search.
maxCreateThe maximum number of subdomains 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. If nullptr, it is ignored.
Returns
The domain found or created.

Definition at line 101 of file domain.cpp.

Here is the call graph for this function:

◆ findRecursive()

Domain * alib::lox::detail::Domain::findRecursive ( NSubstring & domainPath,
int maxCreate,
bool * wasCreated )
protected

Internal, recursive helper of Find.

Parameters
domainPathPath to search.
maxCreateThe maximum number of subdomains 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. If nullptr, it is ignored.
Returns
The domain found or created.

Definition at line 131 of file domain.cpp.

Here is the call graph for this function:

◆ GetCount()

int alib::lox::detail::Domain::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.

Definition at line 270 of file domain.inl.

◆ GetLogger() [1/2]

detail::Logger * alib::lox::detail::Domain::GetLogger ( const NString & 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, nullptr is returned.

Definition at line 198 of file domain.inl.

Here is the call graph for this function:

◆ GetLogger() [2/2]

detail::Logger * alib::lox::detail::Domain::GetLogger ( int no)
inline

Returns logger of given number.

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

Definition at line 209 of file domain.inl.

◆ GetLoggerNo() [1/2]

int alib::lox::detail::Domain::GetLoggerNo ( const NString & 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.

Definition at line 220 of file domain.inl.

Here is the call graph for this function:

◆ GetLoggerNo() [2/2]

int alib::lox::detail::Domain::GetLoggerNo ( detail::Logger * logger)
inline

Returns the number of the Logger.

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

Definition at line 231 of file domain.inl.

◆ GetPriority()

Priority alib::lox::detail::Domain::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.

Definition at line 261 of file domain.inl.

◆ GetRoot()

Domain * alib::lox::detail::Domain::GetRoot ( )
inline

Returns the root domain of this object.

Returns
The root domain of this object

Definition at line 142 of file domain.inl.

Here is the call graph for this function:

◆ GetVerbosity()

Verbosity alib::lox::detail::Domain::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.

Definition at line 253 of file domain.inl.

◆ IsActive()

bool alib::lox::detail::Domain::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 statement.
statementThe Verbosity to check.
Returns
true if domain is active (log should be performed)

Definition at line 281 of file domain.inl.

Here is the call graph for this function:

◆ RemoveLogger()

void alib::lox::detail::Domain::RemoveLogger ( int loggerNo)
inline

Removes an new entry in field Data and recursively demands the same from its Subdomains.

Parameters
loggerNoThe number of the Logger to be removed.

Definition at line 173 of file domain.inl.

Here is the call graph for this function:

◆ removeLoggerRecursive()

void alib::lox::detail::Domain::removeLoggerRecursive ( int loggerNo)
protected

Internal, recursive helper of RemoveLogger.

Parameters
loggerNoThe number of the Logger to be removed.

Definition at line 245 of file domain.cpp.

Here is the call graph for this function:

◆ Separator()

constexpr nchar alib::lox::detail::Domain::Separator ( )
inlinestaticconstexpr
Returns
Returns the domain path separation character.

Definition at line 122 of file domain.inl.

◆ SetVerbosity()

Verbosity alib::lox::detail::Domain::SetVerbosity ( int loggerNo,
Verbosity verbosity,
Priority priority )

Sets the verbosity for a logger of this domain of all its subdomains 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.

Definition at line 224 of file domain.cpp.

Here is the call graph for this function:

◆ ToString()

void alib::lox::detail::Domain::ToString ( NAString & target)

Creates a string representation of this object.

Parameters
targetThe target string.

Definition at line 252 of file domain.cpp.

Here is the call graph for this function:

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