Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

Hierarchy Class Reference

List of all members.

Public Member Functions

 this (char[] name)
char[] getName ()
char[] getAddress ()
void setName (char[] name)
void setAddress (char[] address)
LoggerInstance getRootLogger ()
synchronized LoggerInstance getLogger (char[] name)
int opApply (int(*dg)(inout Logger))

Private Member Functions

void insertLogger (LoggerInstance l)
void updateLoggers (LoggerInstance changed, bool force)
void propogate (LoggerInstance logger, LoggerInstance changed, bool force)

Private Attributes

char[] name
char[] address
LoggerInstance root
LoggerInstance[char[]] loggers

Detailed Description

The Logger hierarchy implementation. We keep a reference to each logger in a hash-table for convenient lookup purposes, plus keep each logger linked to the others in an ordered chain. Ordering places shortest names at the head and longest ones at the tail, making the job of identifying ancestors easier in an orderly fashion. For example, when propogating levels across descendents it would be a mistake to propogate to a child before all of its ancestors were taken care of.

Definition at line 369 of file Hierarchy.d.


Member Function Documentation

this char[]  name  )  [inline]
 

Construct a hierarchy with the given name.

Definition at line 383 of file Hierarchy.d.

char [] getName  )  [inline]
 

Return the name of this Hierarchy

Definition at line 398 of file Hierarchy.d.

Referenced by XmlLayout::format().

char [] getAddress  )  [inline]
 

Return the address of this Hierarchy. This is typically attached when sending events to remote monitors.

Definition at line 410 of file Hierarchy.d.

Referenced by XmlLayout::format().

void setName char[]  name  )  [inline]
 

Set the name of this Hierarchy

Definition at line 421 of file Hierarchy.d.

void setAddress char[]  address  )  [inline]
 

Set the address of this Hierarchy. The address is attached used when sending events to remote monitors.

Definition at line 433 of file Hierarchy.d.

LoggerInstance getRootLogger  )  [inline]
 

Return the root node.

Definition at line 444 of file Hierarchy.d.

Referenced by Manager::getRootLogger().

synchronized LoggerInstance getLogger char[]  name  )  [inline]
 

Return the instance of a Logger with the provided name. If the instance does not exist, it is created at this time.

Definition at line 456 of file Hierarchy.d.

References insertLogger(), loggers, and updateLoggers().

Referenced by Manager::getLogger().

int opApply int(*  dg)(inout Logger)  )  [inline]
 

Iterate over all Loggers in list

Definition at line 486 of file Hierarchy.d.

References Logger.

void insertLogger LoggerInstance  l  )  [inline, private]
 

Loggers are maintained in a sorted linked-list. The order is maintained such that the shortest name is at the root, and the longest at the tail.

This is done so that updateLoggers() will always have a known environment to manipulate, making it much faster.

Definition at line 513 of file Hierarchy.d.

References Exception, LoggerInstance::name, LoggerInstance::next, and propogate().

Referenced by getLogger().

void updateLoggers LoggerInstance  changed,
bool  force
[inline, private]
 

Propogate hierarchical changes across known loggers. This includes changes in the hierarchy itself, and to the various settings of child loggers with respect to their parent(s).

Definition at line 552 of file Hierarchy.d.

References propogate().

Referenced by getLogger(), LoggerInstance::setBreakpoint(), and LoggerInstance::setLevel().

void propogate LoggerInstance  logger,
LoggerInstance  changed,
bool  force
[inline, private]
 

Propogate changes in the hierarchy downward to child Loggers. Note that while 'parent' and 'breakpoint' are always forced to update, the update of 'level' is selectable.

Definition at line 574 of file Hierarchy.d.

References LoggerInstance::breakpoint, LoggerInstance::level, and ILevel::Level.

Referenced by insertLogger(), and updateLoggers().


Member Data Documentation

char [] name [private]
 

Definition at line 371 of file Hierarchy.d.

Referenced by LoggerInstance::this().

char [] address [private]
 

Definition at line 371 of file Hierarchy.d.

LoggerInstance root [private]
 

Definition at line 374 of file Hierarchy.d.

LoggerInstance [char[]] loggers [private]
 

Definition at line 375 of file Hierarchy.d.

Referenced by getLogger().


The documentation for this class was generated from the following file:
Generated on Sun Nov 7 19:07:03 2004 for Mango by doxygen 1.3.6