#include <reporter.hh>
Inheritance diagram for lestes::msg::reporter:

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_filter > | filter_get (void) const |
| Returns active filter. | |
Static Public Member Functions | |
| static ptr< reporter > | instance (void) |
| Returns the reporter. | |
Protected Member Functions | |
| reporter (const reporter &) | |
| Hides copy constructor. | |
| reporter & | operator= (const reporter &) |
| Hides assignment operator. | |
Protected Attributes | |
| srp< report_filter > | filter |
| Filter used for reporting. | |
Static Protected Attributes | |
| static ptr< reporter > | singleton |
| The only instance. | |
Private Member Functions | |
| reporter (void) | |
| Creates the 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.
| 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.
| 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.
a_location != NULL
filter != NULL
| 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 | ) |
| ptr< report_filter > lestes::msg::reporter::filter_get | ( | void | ) | const |
Returns active filter.
Returns active filter.
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.
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 }
Hides assignment operator.
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().
1.5.1-20070107