#include <DefaultStream.h>
Inheritance diagram for ers::DefaultStream:
Public Member Functions | |
DefaultStream (bool verbose=false) | |
DefaultStream (bool verbose=false) | |
operator std::string () const | |
operator std::string () const | |
virtual void | print_to (std::ostream &stream) const |
virtual void | print_to (std::ostream &stream) const |
virtual Issue * | receive () |
Receives an issue from the stream. | |
virtual Issue * | receive () |
Receives an issue from the stream. | |
void | send (const Issue *ptr) |
Sends an issue into the stream. | |
void | send (const Issue *ptr) |
~DefaultStream () | |
~DefaultStream () | |
Static Public Attributes | |
const char *const | KEY |
const char *const | KEY = "default" |
const char *const | NULL_STREAM_KEY |
const char *const | NULL_STREAM_KEY = "null" |
const char *const | VERBOSE_KEY |
const char *const | VERBOSE_KEY = "verbose" |
Protected Attributes | |
bool | m_verbose |
This class displas an Issue on the standard error stream This class is meant to be used as default stream for simple on screen display. More advanced streams are offered in the System
package This stream only sends output to the standard error stream. To select this stream, simply use the default
string key. You can get a verbose output by
|
00032 { 00033 m_verbose = verbose ; 00034 } // DefaultStream
|
|
00037 {}
|
|
|
|
|
|
|
|
00035 { 00036 std::ostringstream stream ; 00037 print_to(stream); 00038 return stream.str(); 00039 } // to string
|
|
Reimplemented in ers::FIFOStream, ers::FilterStream, ers::HumanStream, ers::FIFOStream, ers::FilterStream, and ers::HumanStream. |
|
Reimplemented in ers::FIFOStream, ers::FilterStream, ers::HumanStream, ers::FIFOStream, ers::FilterStream, and ers::HumanStream. 00059 { 00060 stream << NULL_STREAM_KEY << ':' ; 00061 } // print_to
|
|
Receives an issue from the stream.
Reimplemented in ers::FIFOStream, and ers::FIFOStream. |
|
Receives an issue from the stream. Reads an isssue on the stream
Reimplemented in ers::FIFOStream, and ers::FIFOStream. 00055 { 00056 return 0 ; 00057 } // receive
|
|
Sends an issue into the stream. Sends the issue to the stream.
Reimplemented from ers::Stream. |
|
We print the stream in a semi-tabbed mode. The message is first printed out, then a list of all properties.
Reimplemented from ers::Stream. 00045 { 00046 ERS_PRE_CHECK_PTR(issue_ptr); 00047 try { 00048 const string_map_type *table = issue_ptr->get_value_table(); 00049 const std::string & message_str = issue_ptr->get_value(Issue::MESSAGE_KEY) ; 00050 const std::string & severity_str = issue_ptr->get_value(Issue::SEVERITY_KEY) ; 00051 const std::string & position_str = issue_ptr->get_value(Issue::SOURCE_POSITION_KEY) ; 00052 const std::string & date_str = issue_ptr->get_value(Issue::TIME_KEY); 00053 00054 std::ostream & out = issue_ptr->severity() < warning ? std::cout : std::cerr; 00055 00056 out << severity_str << " at " << position_str << " (" << date_str << "): " << message_str << std::endl ; 00057 if (m_verbose) { 00058 out << "-----------" << std::endl ; 00059 for(string_map_type::const_iterator pos = table->begin();pos!=table->end();++pos) { 00060 const std::string &key = pos->first ; 00061 const std::string &value = pos->second ; 00062 out << key << "=\t\"" << value << '\"' << std::endl ; 00063 } // for 00064 out << "-----------" << std::endl ; 00065 } // if long format 00066 } catch (std::ios_base::failure &ex) { 00067 throw ers::Issue(ERS_HERE,ers::error,&ex); 00068 } // catch generic I/O errors 00069 00070 } // send
|
|
|
|
The key for this stream is |
|
|
|
Key for discard stream |
|
Key for discard stream |
|
|
|
|