BOSS 7.0.6
BESIII Offline Software System
Loading...
Searching...
No Matches
ers::Stream Class Reference

Root/Null issue stream. More...

#include <Stream.h>

+ Inheritance diagram for ers::Stream:

Public Member Functions

 Stream ()
 
 Stream (const Stream &other)
 
 operator std::string () const
 
virtual ~Stream ()
 
virtual void send (const Issue *i)
 Sends an issue into the stream.
 
virtual Issuereceive ()
 Receives an issue from the stream.
 
virtual void print_to (std::ostream &stream) const
 

Static Public Attributes

static const char *const NULL_STREAM_KEY = "null"
 

Friends

class Issue
 

Detailed Description

Root/Null issue stream.

Root issue stream. An ERS stream is a mean to send and receive issues. The two core method to do so are send and receive. Certain subclasses of stream might implement only sending, or only receiving. The root stream class implements a null stream, i.e a stream where no issue can be read from and silently discards sent issues.

Author
Matthias Wiesmann
Version
1.0

Definition at line 35 of file Stream.h.

Constructor & Destructor Documentation

◆ Stream() [1/2]

ers::Stream::Stream ( )

Definition at line 31 of file Stream.cxx.

31{}

◆ Stream() [2/2]

ers::Stream::Stream ( const Stream other)

Definition at line 32 of file Stream.cxx.

32{}

◆ ~Stream()

ers::Stream::~Stream ( )
virtual

Definition at line 33 of file Stream.cxx.

33{}

Member Function Documentation

◆ operator std::string()

ers::Stream::operator std::string ( ) const

Definition at line 35 of file Stream.cxx.

35 {
36 std::ostringstream stream ;
37 print_to(stream);
38 return stream.str();
39} // to string
virtual void print_to(std::ostream &stream) const
Definition: Stream.cxx:59

◆ print_to()

void ers::Stream::print_to ( std::ostream &  stream) const
virtual

Reimplemented in ers::FIFOStream, ers::FilterStream, and ers::HumanStream.

Definition at line 59 of file Stream.cxx.

59 {
60 stream << NULL_STREAM_KEY << ':' ;
61} // print_to
static const char *const NULL_STREAM_KEY
Definition: Stream.h:39

◆ receive()

ers::Issue * ers::Stream::receive ( )
virtual

Receives an issue from the stream.

Reads an isssue on the stream

Returns
the issue that has been read
Note
This implementation always returns a null pointer

Reimplemented in ers::FIFOStream.

Definition at line 55 of file Stream.cxx.

55 {
56 return 0 ;
57} // receive

◆ send()

void ers::Stream::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 in ers::FIFOStream, ers::FilterStream, ers::DefaultStream, and ers::HumanStream.

Definition at line 46 of file Stream.cxx.

46 {
47 (void) i ;
48} // send

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

Friends And Related Function Documentation

◆ Issue

friend class Issue
friend

Definition at line 36 of file Stream.h.

Member Data Documentation

◆ NULL_STREAM_KEY

const char *const ers::Stream::NULL_STREAM_KEY = "null"
static

Key for discard stream

Definition at line 39 of file Stream.h.


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