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 376 of file Hierarchy.d.


Member Function Documentation

this char[]  name  )  [inline]
 

Construct a hierarchy with the given name.

Definition at line 390 of file Hierarchy.d.

char [] getName  )  [inline]
 

Return the name of this Hierarchy

Definition at line 405 of file Hierarchy.d.

char [] getAddress  )  [inline]
 

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

Definition at line 417 of file Hierarchy.d.

void setName char[]  name  )  [inline]
 

Set the name of this Hierarchy

Definition at line 428 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 440 of file Hierarchy.d.

LoggerInstance getRootLogger  )  [inline]
 

Return the root node.

Definition at line 451 of file Hierarchy.d.

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 463 of file Hierarchy.d.

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

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

Iterate over all Loggers in list

Definition at line 493 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 520 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 559 of file Hierarchy.d.

References LoggerInstance::next, and 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 581 of file Hierarchy.d.

References LoggerInstance::breakpoint, LoggerInstance::isCloserAncestor(), LoggerInstance::level, and LoggerInstance::parent.

Referenced by insertLogger(), and updateLoggers().


Member Data Documentation

char [] name [private]
 

Definition at line 378 of file Hierarchy.d.

Referenced by LoggerInstance::this().

char [] address [private]
 

Definition at line 378 of file Hierarchy.d.

LoggerInstance root [private]
 

Definition at line 381 of file Hierarchy.d.

LoggerInstance [char[]] loggers [private]
 

Definition at line 382 of file Hierarchy.d.

Referenced by getLogger().


The documentation for this class was generated from the following file:
Generated on Sun Mar 6 00:31:09 2005 for Mango by doxygen 1.3.6