BOSS 7.0.4
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
 
 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 Event/ers/ers-00-00-03/ers/Stream.h.

Constructor & Destructor Documentation

◆ Stream() [1/4]

ers::Stream::Stream ( )

Definition at line 31 of file Stream.cxx.

31{}

◆ Stream() [2/4]

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

Definition at line 32 of file Stream.cxx.

32{}

◆ ~Stream() [1/2]

ers::Stream::~Stream ( )
virtual

Definition at line 33 of file Stream.cxx.

33{}

◆ Stream() [3/4]

ers::Stream::Stream ( )

◆ Stream() [4/4]

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

◆ ~Stream() [2/2]

virtual ers::Stream::~Stream ( )
virtual

Member Function Documentation

◆ operator std::string() [1/2]

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

◆ operator std::string() [2/2]

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

◆ print_to() [1/2]

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

Reimplemented in ers::FIFOStream, ers::FilterStream, ers::HumanStream, 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

◆ print_to() [2/2]

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

◆ receive() [1/2]

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, and ers::FIFOStream.

Definition at line 55 of file Stream.cxx.

55 {
56 return 0 ;
57} // receive

◆ receive() [2/2]

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

Receives an issue from the stream.

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

◆ send() [1/2]

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

Definition at line 46 of file Stream.cxx.

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

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

◆ send() [2/2]

virtual void ers::Stream::send ( const Issue i)
virtual

Friends And Related Function Documentation

◆ Issue

Issue
friend

Definition at line 36 of file Event/ers/ers-00-00-03/ers/Stream.h.

Member Data Documentation

◆ NULL_STREAM_KEY

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

Key for discard stream

Definition at line 39 of file Event/ers/ers-00-00-03/ers/Stream.h.


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