lestes::msg::report_cache Class Reference

Report cache. More...

#include <report_cache.hh>

Inheritance diagram for lestes::msg::report_cache:

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)
 Caches a report.
ptr< messagemessage_get (void) const
 Returns cached message.
ptr< source_location > location_get (void) const
 Returns cached location.

Static Public Member Functions

static ptr< report_cachecreate (const ptr< report_filter > &a_output)
 Returns new instance.

Protected Member Functions

 report_cache (const ptr< report_filter > &a_output)
 Creates the object.

Private Member Functions

 report_cache (const report_cache &)
 Hides copy constructor.
report_cacheoperator= (const report_cache &)
 Hides assignment operator.

Private Attributes

srp< messagecached_message
 Last cached message.
srp< source_location > cached_location
 Last cached location.

Detailed Description

Report cache.

Represents cache, saving last report for examination. Used for testing.

Definition at line 55 of file report_cache.hh.


Constructor & Destructor Documentation

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

Creates the object.

Creates the report end filter.

Postcondition:
message_get() == NULL

location_get() == NULL

Parameters:
a_output The output of the filter.

Definition at line 48 of file report_cache.cc.

Referenced by create().

00048                                                             :
00049         report_filter(a_output),
00050         cached_message(NULL),
00051         cached_location(NULL)
00052 {
00053 }
        

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

Hides copy constructor.


Member Function Documentation

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

Caches a report.

Caches current report

Precondition:
a_message != NULL

a_location != NULL

Parameters:
a_message The message to cache.
a_location The location to cache.

Implements lestes::msg::report_filter.

Definition at line 62 of file report_cache.cc.

References cached_location, cached_message, lassert, and lestes::msg::report_filter::process_output().

00064 {
00065         lassert(a_message);
00066         lassert(a_location);
00067 
00068         cached_message = a_message;
00069         cached_location = a_location;
00070         
00071         process_output(a_message,a_location);
00072 }

ptr< message > lestes::msg::report_cache::message_get ( void   )  const

Returns cached message.

Returns the last message passed process().

Returns:
Last message or NULL if process() was not called yet.

Definition at line 78 of file report_cache.cc.

References cached_message.

00079 {
00080         return cached_message;
00081 }

ptr< source_location > lestes::msg::report_cache::location_get ( void   )  const

Returns cached location.

Returns the last location passed to process().

Returns:
Last location or NULL if process() was not called yet.

Definition at line 87 of file report_cache.cc.

References cached_location.

00088 {
00089         return cached_location;
00090 }

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

Returns new instance.

Returns new object.

Precondition:
a_output != NULL
Parameters:
a_output The output of the filter.
Returns:
New report cache filter.

Definition at line 98 of file report_cache.cc.

References report_cache().

00099 {
00100         return new report_cache(a_output);
00101 }

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

Hides assignment operator.


Member Data Documentation

srp<message> lestes::msg::report_cache::cached_message [private]

Last cached message.

Definition at line 71 of file report_cache.hh.

Referenced by message_get(), and process().

srp<source_location> lestes::msg::report_cache::cached_location [private]

Last cached location.

Definition at line 73 of file report_cache.hh.

Referenced by location_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