DGtal  0.6.devel
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
TraceWriter.h
1 
17 #pragma once
18 
30 #if defined(TraceWriter_RECURSES)
31 #error Recursive header files inclusion detected in TraceWriter.h
32 #else // defined(TraceWriter_RECURSES)
33 
34 #define TraceWriter_RECURSES
35 
36 #if !defined TraceWriter_h
37 
38 #define TraceWriter_h
39 
41 // Inclusions
42 #include <iostream>
43 #include <ostream>
45 
46 namespace DGtal
47 {
48 
50  // class TraceWriter
58  {
59  // ----------------------- Standard services ------------------------------
60  public:
61 
62  // ----------------------- Interface --------------------------------------
63  public:
64 
69  void selfDisplay( std::ostream & out ) const;
70 
75  bool isValid() const;
76 
77 
78  virtual std::string prefixWarning() = 0;
79  virtual std::string prefixInfo() = 0;
80  virtual std::string prefixError() = 0;
81  virtual std::string prefixEmphase() = 0;
82  virtual std::string postfixReset() = 0;
83 
84  std::ostream & outputStream() {return myOutputStream;};
85 
86  // ------------------------- Protected Datas ------------------------------
87  protected:
88 
90  std::ostream &myOutputStream;
91 
92 
93  // ------------------------- Private Datas --------------------------------
94  private:
95 
96  // ------------------------- Hidden services ------------------------------
97  protected:
98 
103  TraceWriter(std::ostream &aoutputStream) : myOutputStream(aoutputStream) {};
104 
105 
106 
107 
108  private:
109 
115  TraceWriter( const TraceWriter & other );
116 
123  TraceWriter & operator=( const TraceWriter & other );
124 
125  // ------------------------- Internals ------------------------------------
126  private:
127 
128  }; // end of class TraceWriter
129 
130 
137  std::ostream&
138  operator<<( std::ostream & out, const TraceWriter & object );
139 
140 
141 } // namespace DGtal
142 
143  //
145 
146 #endif // !defined TraceWriter_h
147 
148 #undef TraceWriter_RECURSES
149 #endif // else defined(TraceWriter_RECURSES)