lestes::msg::report_error_flag Class Reference

Report filter. More...

#include <report_error_flag.hh>

Inheritance diagram for lestes::msg::report_error_flag:

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

Public Member Functions

virtual void process (const ptr< message > &a_message, const ptr< source_location > &a_location)
 Processes a report.
bool error_get (void) const
 Returns error flag.

Static Public Member Functions

static ptr< report_error_flagcreate (const ptr< report_filter > &a_output)
 Factory method.

Protected Member Functions

 report_error_flag (const ptr< report_filter > &a_output)
 Creates a filter with output.

Private Member Functions

 report_error_flag (const report_error_flag &)
 Hides copy constructor.
report_error_flagoperator= (const report_error_flag &)
 Hides assignment operator.

Private Attributes

bool error
 Has an error already occured?

Detailed Description

Report filter.

Represents abstract filter of reported messages with location. Each inherited filter is intended to either perform an optional transformation on a report and call process_output(), or filter it out by not calling process_output(). Individual filters' create methods should reserve first parameter to specifying output, followed by other specific parameters, to enable easy chaining of filters.

Definition at line 59 of file report_error_flag.hh.


Constructor & Destructor Documentation

lestes::msg::report_error_flag::report_error_flag ( const ptr< report_filter > &  a_output  )  [protected]

Creates a filter with output.

Creates a filter, initializes with output.

Precondition:
a_output != NULL
Postcondition:
output_get() == a_output
Parameters:
a_output The output of the filter.

Definition at line 55 of file report_error_flag.cc.

Referenced by create().

00055                                                                       :
00056         report_filter(a_output),
00057         error(false)
00058 {
00059 }

lestes::msg::report_error_flag::report_error_flag ( const report_error_flag  )  [private]

Hides copy constructor.


Member Function Documentation

void lestes::msg::report_error_flag::process ( const ptr< message > &  a_message,
const ptr< source_location > &  a_location 
) [virtual]

Processes a report.

Processes a report by output.

Precondition:
a_message != NULL

a_location != NULL

output != NULL

Parameters:
a_message The message to pass to the output.
a_location The location to pass to the output.

Implements lestes::msg::report_filter.

Definition at line 69 of file report_error_flag.cc.

References error, lestes::msg::message::FLG_ERROR, lassert, and lestes::msg::report_filter::process_output().

00071 {
00072         lassert(a_message);
00073         lassert(a_location);
00074 
00075         if (a_message->flags_get() == message::FLG_ERROR)
00076                 error = true;
00077 
00078         process_output(a_message,a_location);
00079 }

bool lestes::msg::report_error_flag::error_get ( void   )  const

Returns error flag.

Todo:
:)

Definition at line 83 of file report_error_flag.cc.

References error.

00084 {
00085         return error;
00086 }

ptr< report_error_flag > lestes::msg::report_error_flag::create ( const ptr< report_filter > &  a_output  )  [static]

Factory method.

Todo:

Definition at line 44 of file report_error_flag.cc.

References report_error_flag().

00045 {
00046         return new report_error_flag(a_output);
00047 }

report_error_flag& lestes::msg::report_error_flag::operator= ( const report_error_flag  )  [private]

Hides assignment operator.


Member Data Documentation

bool lestes::msg::report_error_flag::error [private]

Has an error already occured?

Definition at line 73 of file report_error_flag.hh.

Referenced by error_get(), and process().


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