fpmas 1.6
formatted_output.h
Go to the documentation of this file.
1#ifndef FPMAS_FORMATTED_OUTPUT_H
2#define FPMAS_FORMATTED_OUTPUT_H
3
4#include "output.h"
5
10namespace fpmas { namespace io {
11
23 template<typename T>
24 class FormattedOutput : public OutputBase {
25 private:
26 Watcher<T> watcher;
27 bool insert_new_line;
28 public:
40 Watcher<T> watcher,
41 bool insert_new_line = false
42 ) :
44 watcher(watcher),
45 insert_new_line(insert_new_line) {
46 }
47
55 void dump() override {
56 output_stream.get() << watcher();
57 if(insert_new_line)
58 output_stream.get() << std::endl;
59 }
60 };
61}}
62#endif
Definition: formatted_output.h:24
FormattedOutput(api::io::OutputStream &output_stream, Watcher< T > watcher, bool insert_new_line=false)
Definition: formatted_output.h:38
void dump() override
Definition: formatted_output.h:55
Definition: output.h:571
api::io::OutputStream & output_stream
Definition: output.h:580
Definition: fpmas.cpp:3
Definition: output.h:67
virtual std::ostream & get()=0