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