SST/macro
output.h
Go to the documentation of this file.
1 #ifndef sprockit_common_OUTPUT_H
2 #define sprockit_common_OUTPUT_H
3 
4 #include <iostream>
5 
6 #define cout0 ::sprockit::output::out0()
7 #define coutn ::sprockit::output::outn()
8 #define cerr0 ::sprockit::output::err0()
9 #define cerrn ::sprockit::output::errn()
10 
11 
12 namespace sprockit {
13 
14 class output
15 {
16  public:
17  static std::ostream&
18  out0() {
19  return (*out0_);
20  }
21 
22  static std::ostream&
23  outn() {
24  return (*outn_);
25  }
26 
27  static std::ostream&
28  err0() {
29  return (*err0_);
30  }
31 
32  static std::ostream&
33  errn() {
34  return (*errn_);
35  }
36 
37  static void
38  init_out0(std::ostream* out0){
39  out0_ = out0;
40  }
41 
42  static void
43  init_outn(std::ostream* outn){
44  outn_ = outn;
45  }
46 
47  static void
48  init_err0(std::ostream* err0){
49  err0_ = err0;
50  }
51 
52  static void
53  init_errn(std::ostream* errn){
54  errn_ = errn;
55  }
56 
57  protected:
58  static std::ostream* out0_;
59  static std::ostream* outn_;
60  static std::ostream* err0_;
61  static std::ostream* errn_;
62 
63 };
64 
65 }
66 
67 #endif // OUTPUT_H
static std::ostream * outn_
Definition: output.h:59
static std::ostream * err0_
Definition: output.h:60
static std::ostream & errn()
Definition: output.h:33
static void init_errn(std::ostream *errn)
Definition: output.h:53
static void init_err0(std::ostream *err0)
Definition: output.h:48
static std::ostream * out0_
Definition: output.h:58
static void init_outn(std::ostream *outn)
Definition: output.h:43
static std::ostream * errn_
Definition: output.h:61
static void init_out0(std::ostream *out0)
Definition: output.h:38
static std::ostream & outn()
Definition: output.h:23
static std::ostream & out0()
Definition: output.h:18
static std::ostream & err0()
Definition: output.h:28