OStream.h
Go to the documentation of this file.
1 #ifndef OM_OSTREAM_H
2 #define OM_OSTREAM_H
3 #include <sstream>
4 namespace om { class LogViewer; }
5 
6 namespace om {
7  ///
8  /// Define an output stream the streams to the log viewer
9  ///
10  class OStream {
11  public:
12  OStream();
13  void Flush();
14  void SetLogViewer(om::LogViewer* lv);
15 
16  private:
17  std::ostringstream fBuf;
19 
20  public:
21  template <class T> OStream& operator<<(const T& a) {
22  fBuf.str("");
23  fBuf << a;
24  this->Flush();
25  return *this;
26  }
27  };
28 
29  extern OStream cout;
30  extern OStream cerr;
31 }
32 #endif
33 ////////////////////////////////////////////////////////////////////////
void SetLogViewer(om::LogViewer *lv)
Definition: OStream.cxx:28
OStream cerr
Definition: OStream.cxx:7
std::ostringstream fBuf
Definition: OStream.h:17
const double a
om::LogViewer * fLogViewer
Definition: OStream.h:18
OStream cout
Definition: OStream.cxx:6
OStream & operator<<(const T &a)
Definition: OStream.h:21
double T
Definition: Xdiff_gwt.C:5
void Flush()
Definition: OStream.cxx:15
Online Monitoring package header.