00001 00010 #ifndef BufferedOutput_HPP 00011 #define BufferedOutput_HPP 00012 00013 00014 #include "io/output/OutputBase.hpp" 00015 #include "io/FDRepr.hpp" 00016 00017 template <class FR = FDRepr> 00018 class BufferedOutput : public OutputBase<FR> 00019 { 00020 public: 00021 class params_t : public OutputBase<FR>::params_t 00022 { 00023 public: 00024 std::streamsize buffer_size; 00025 params_t():OutputBase<FR>::params_t() 00026 { 00027 buffer_size = 4 * 1024; 00028 } 00029 }; 00030 00031 BufferedOutput(const params_t* par): 00032 OutputBase<FR>(par),buffer_size(par->buffer_size) 00033 { 00034 buffer = new char[buffer_size]; 00035 } 00036 00037 ~BufferedOutput() 00038 { 00039 delete [] buffer; 00040 } 00041 00042 00043 protected: 00045 std::streamsize buffer_size; 00047 char* buffer; 00048 }; 00049 00050 #endif