lestes::msg::reporter Class Reference

Message reporter. More...

#include <reporter.hh>

Inheritance diagram for lestes::msg::reporter:

lestes::std::object lestes::std::mem::keystone List of all members.

Public Member Functions

void report (const ptr< message > &a_message, const ptr< source_location > &a_location)
 Reports message at location.
void filter_set (const ptr< report_filter > &a_filter)
 Sets active filter.
ptr< report_filterfilter_get (void) const
 Returns active filter.

Static Public Member Functions

static ptr< reporterinstance (void)
 Returns the reporter.

Protected Member Functions

 reporter (const reporter &)
 Hides copy constructor.
reporteroperator= (const reporter &)
 Hides assignment operator.

Protected Attributes

srp< report_filterfilter
 Filter used for reporting.

Static Protected Attributes

static ptr< reportersingleton
 The only instance.

Private Member Functions

 reporter (void)
 Creates the reporter.

Detailed Description

Message reporter.

Represents singleton reporter of messages with location. The behaviour is altered by setting the filter to process the messages.

Definition at line 58 of file reporter.hh.


Constructor & Destructor Documentation

lestes::msg::reporter::reporter ( void   )  [private]

Creates the reporter.

Creates the only reporter.

Definition at line 48 of file reporter.cc.

Referenced by instance().

00048                       :
00049         filter(report_end::create())
00050 {
00051 }

lestes::msg::reporter::reporter ( const reporter  )  [protected]

Hides copy constructor.


Member Function Documentation

void lestes::msg::reporter::report ( const ptr< message > &  a_message,
const ptr< source_location > &  a_location 
)

Reports message at location.

Reports message at location. Calls process of the active filter.

Precondition:
a_message != NULL

a_location != NULL

filter != NULL

Parameters:
a_message The message to report.
a_location The associated location.

Definition at line 61 of file reporter.cc.

References filter, and lassert.

00063 {
00064         lassert(a_message);
00065         lassert(a_location);
00066         
00067         filter->process(a_message,a_location);
00068 }

void lestes::msg::reporter::filter_set ( const ptr< report_filter > &  a_filter  ) 

Sets active filter.

Sets report filter to use for processing reports.

Precondition:
a_filter != NULL
Parameters:
a_filter The filter to set.

Definition at line 75 of file reporter.cc.

References filter, and lassert.

00076 {
00077         lassert(a_filter);
00078         filter = a_filter;
00079 }

ptr< report_filter > lestes::msg::reporter::filter_get ( void   )  const

Returns active filter.

Returns active filter.

Returns:
The filter processing the reports.

Definition at line 85 of file reporter.cc.

References filter.

00086 {
00087         return filter;
00088 }

ptr< reporter > lestes::msg::reporter::instance ( void   )  [static]

Returns the reporter.

Returns the only instance of the object.

Returns:
The singleton reporter object.

Definition at line 94 of file reporter.cc.

References reporter(), and singleton.

Referenced by lestes::std::operator<<(), and lestes::lang::cplus::lex::run().

00095 {
00096         if (!singleton) {
00097                 singleton = new reporter();
00098         }
00099         return singleton;
00100 }

reporter& lestes::msg::reporter::operator= ( const reporter  )  [protected]

Hides assignment operator.


Member Data Documentation

srp<report_filter> lestes::msg::reporter::filter [protected]

Filter used for reporting.

Definition at line 74 of file reporter.hh.

Referenced by filter_get(), filter_set(), and report().

ptr< reporter > lestes::msg::reporter::singleton [static, protected]

The only instance.

The only instance of the class. Uses lazy instantiation.

Definition at line 80 of file reporter.hh.

Referenced by instance().


The documentation for this class was generated from the following files:
Generated on Mon Feb 12 18:25:54 2007 for lestes by doxygen 1.5.1-20070107