BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
ers::DefaultStream Class Reference

Default Issue display. More...

#include <DefaultStream.h>

Inheritance diagram for ers::DefaultStream:

Public Member Functions

 DefaultStream (bool verbose=false)
 ~DefaultStream ()
void send (const Issue *ptr)
 DefaultStream (bool verbose=false)
 ~DefaultStream ()
void send (const Issue *ptr)
 Sends an issue into the stream.
 DefaultStream (bool verbose=false)
 ~DefaultStream ()
void send (const Issue *ptr)
 Sends an issue into the stream.
Public Member Functions inherited from ers::Stream
 Stream ()
 Stream (const Stream &other)
 operator std::string () const
virtual ~Stream ()
virtual Issuereceive ()
 Receives an issue from the stream.
virtual void print_to (std::ostream &stream) const
 Stream ()
 Stream (const Stream &other)
 operator std::string () const
virtual ~Stream ()
virtual Issuereceive ()
 Receives an issue from the stream.
virtual void print_to (std::ostream &stream) const
 Stream ()
 Stream (const Stream &other)
 operator std::string () const
virtual ~Stream ()
virtual Issuereceive ()
 Receives an issue from the stream.
virtual void print_to (std::ostream &stream) const

Static Public Attributes

static const char *const KEY = "default"
static const char *const VERBOSE_KEY = "verbose"
Static Public Attributes inherited from ers::Stream
static const char *const NULL_STREAM_KEY = "null"

Protected Attributes

bool m_verbose

Detailed Description

Default Issue display.

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

Author
Matthias Wiesmann
Version
1.0

Definition at line 28 of file Event/ers/include/ers/DefaultStream.h.

Constructor & Destructor Documentation

◆ DefaultStream() [1/3]

ers::DefaultStream::DefaultStream ( bool verbose = false)

Definition at line 34 of file DefaultStream.cxx.

34{ m_verbose = verbose; } // DefaultStream

◆ ~DefaultStream() [1/3]

ers::DefaultStream::~DefaultStream ( )

Definition at line 36 of file DefaultStream.cxx.

36{}

◆ DefaultStream() [2/3]

ers::DefaultStream::DefaultStream ( bool verbose = false)

◆ ~DefaultStream() [2/3]

ers::DefaultStream::~DefaultStream ( )

◆ DefaultStream() [3/3]

ers::DefaultStream::DefaultStream ( bool verbose = false)

◆ ~DefaultStream() [3/3]

ers::DefaultStream::~DefaultStream ( )

Member Function Documentation

◆ send() [1/3]

void ers::DefaultStream::send ( const Issue * issue_ptr)
virtual

We print the stream in a semi-tabbed mode. The message is first printed out, then a list of all properties.

Parameters
issue_ptrreference to the issue to print
Note
The format produced by this class is subject to change!

Reimplemented from ers::Stream.

Definition at line 44 of file DefaultStream.cxx.

44 {
45 ERS_PRE_CHECK_PTR( issue_ptr );
46 try
47 {
48 const string_map_type* table = issue_ptr->get_value_table();
49 const std::string& message_str = issue_ptr->get_value( Issue::MESSAGE_KEY );
50 const std::string& severity_str = issue_ptr->get_value( Issue::SEVERITY_KEY );
51 const std::string& position_str = issue_ptr->get_value( Issue::SOURCE_POSITION_KEY );
52 const std::string& date_str = issue_ptr->get_value( Issue::TIME_KEY );
53
54 std::ostream& out = issue_ptr->severity() < warning ? std::cout : std::cerr;
55
56 out << severity_str << " at " << position_str << " (" << date_str << "): " << message_str
57 << std::endl;
58 if ( m_verbose )
59 {
60 out << "-----------" << std::endl;
61 for ( string_map_type::const_iterator pos = table->begin(); pos != table->end(); ++pos )
62 {
63 const std::string& key = pos->first;
64 const std::string& value = pos->second;
65 out << key << "=\t\"" << value << '\"' << std::endl;
66 } // for
67 out << "-----------" << std::endl;
68 } // if long format
69 } catch ( std::ios_base::failure& ex )
70 { throw ers::Issue( ERS_HERE, ers::error, &ex ); } // catch generic I/O errors
71
72} // send
*************DOUBLE PRECISION m_pi *DOUBLE PRECISION m_HvecTau2 DOUBLE PRECISION m_HvClone2 DOUBLE PRECISION m_gamma1 DOUBLE PRECISION m_gamma2 DOUBLE PRECISION m_thet1 DOUBLE PRECISION m_thet2 INTEGER m_IFPHOT *COMMON c_Taupair $ !Spin Polarimeter vector first Tau $ !Spin Polarimeter vector second Tau $ !Clone Spin Polarimeter vector first Tau $ !Clone Spin Polarimeter vector second Tau $ !Random Euler angle for cloning st tau $ !Random Euler angle for cloning st tau $ !Random Euler angle for cloning st tau $ !Random Euler angle for cloning nd tau $ !Random Euler angle for cloning nd tau $ !Random Euler angle for cloning nd tau $ !phi of HvecTau1 $ !theta of HvecTau1 $ !phi of HvecTau2 $ !theta of HvecTau2 $ !super key
Definition Taupair.h:42
static const char *const TIME_KEY
key for the time of the issue (text)
static const char *const SEVERITY_KEY
key for the severity_t of the issue
static const char *const SOURCE_POSITION_KEY
key for position in the source code
static const char *const MESSAGE_KEY
key for human readable
std::map< std::string, std::string > string_map_type

◆ send() [2/3]

void ers::DefaultStream::send ( const Issue * i)
virtual

Sends an issue into the stream.

Sends the issue to the stream.

Parameters
ithe issue to send
Note
This implementation silently discards the Issue

Reimplemented from ers::Stream.

◆ send() [3/3]

void ers::DefaultStream::send ( const Issue * i)
virtual

Sends an issue into the stream.

Sends the issue to the stream.

Parameters
ithe issue to send
Note
This implementation silently discards the Issue

Reimplemented from ers::Stream.

Member Data Documentation

◆ KEY

const char *const ers::DefaultStream::KEY = "default"
static

The key for this stream is default the URI field is ignored

Definition at line 33 of file Event/ers/include/ers/DefaultStream.h.

Referenced by ers::StreamFactory::key_for_severity().

◆ m_verbose

bool ers::DefaultStream::m_verbose
protected

Definition at line 30 of file Event/ers/include/ers/DefaultStream.h.

Referenced by DefaultStream(), and send().

◆ VERBOSE_KEY

const char *const ers::DefaultStream::VERBOSE_KEY = "verbose"
static

Definition at line 34 of file Event/ers/include/ers/DefaultStream.h.


The documentation for this class was generated from the following files: