BOSS 8.0.0
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
 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 32 of file Event/ers/include/ers/Stream.h.

Constructor & Destructor Documentation

◆ Stream() [1/6]

◆ Stream() [2/6]

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

Definition at line 33 of file Stream.cxx.

33{}

◆ ~Stream() [1/3]

ers::Stream::~Stream ( )
virtual

Definition at line 34 of file Stream.cxx.

34{}

◆ Stream() [3/6]

ers::Stream::Stream ( )

◆ Stream() [4/6]

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

◆ ~Stream() [2/3]

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

◆ Stream() [5/6]

ers::Stream::Stream ( )

◆ Stream() [6/6]

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

◆ ~Stream() [3/3]

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

Member Function Documentation

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

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

Definition at line 36 of file Stream.cxx.

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

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

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

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

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

◆ print_to() [1/3]

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

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

Definition at line 56 of file Stream.cxx.

56 {
57 stream << NULL_STREAM_KEY << ':';
58} // print_to
static const char *const NULL_STREAM_KEY

Referenced by operator std::string().

◆ print_to() [2/3]

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

◆ print_to() [3/3]

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

◆ receive() [1/3]

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

Definition at line 54 of file Stream.cxx.

54{ return 0; } // receive

◆ receive() [2/3]

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

Receives an issue from the stream.

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

◆ receive() [3/3]

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

Receives an issue from the stream.

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

◆ send() [1/3]

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

Definition at line 47 of file Stream.cxx.

47{ (void)i; } // send

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

◆ send() [2/3]

◆ send() [3/3]

◆ Issue

Member Data Documentation

◆ NULL_STREAM_KEY

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

Key for discard stream

Definition at line 37 of file Event/ers/include/ers/Stream.h.

Referenced by print_to().


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