BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
Event/ers/include/ers/Stream.h
Go to the documentation of this file.
1/*
2 * Stream.h
3 * ers
4 *
5 * Created by Matthias Wiesmann on 02.12.04.
6 * Copyright 2004 CERN. All rights reserved.
7 *
8 */
9
10#ifndef __ERS_ISSUE_STREAM__
11#define __ERS_ISSUE_STREAM__
12
13#include <iostream>
14#include <string>
15
16#include "ers/Context.h"
17#include "ers/Core.h"
18
19namespace ers {
20
21 class Issue;
22
23 /** Root issue stream.
24 * An ERS stream is a mean to send and receive issues.
25 * The two core method to do so are \c send and \c receive.
26 * Certain subclasses of stream might implement only sending, or only receiving.
27 * The root stream class implements a null stream, i.e a stream where no issue can be read
28 * from and silently discards sent issues. \author Matthias Wiesmann \version 1.0 \brief
29 * Root/Null issue stream
30 */
31
32 class Stream {
33 friend class Issue;
34
35 protected:
36 public:
37 static const char* const NULL_STREAM_KEY; /**< Key for discard stream */
38 Stream();
39 Stream( const Stream& other );
40 operator std::string() const;
41 virtual ~Stream();
42 virtual void send( const Issue* i ); /**< \brief Sends an issue into the stream */
43 virtual Issue* receive(); /**< \brief Receives an issue from the stream */
44 virtual void print_to( std::ostream& stream ) const;
45 };
46 std::ostream& operator<<( std::ostream& target, const ers::Stream& s );
47
48} // namespace ers
49
50#endif
XmlRpcServer s
Root Issue class.
Root/Null issue stream.
virtual ~Stream()
Definition Stream.cxx:34
virtual void print_to(std::ostream &stream) const
Definition Stream.cxx:56
virtual void send(const Issue *i)
Sends an issue into the stream.
Definition Stream.cxx:47
virtual Issue * receive()
Receives an issue from the stream.
Definition Stream.cxx:54
static const char *const NULL_STREAM_KEY
std::ostream & operator<<(std::ostream &, const Issue &)