CAFE
Computational Analysis of gene Family Evolution
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
log_buffer.h
Go to the documentation of this file.
1 #ifndef LOG_BUFFER_H_BFB0BCB2_DD7C_421B_8BCC_039B98DC0072
2 #define LOG_BUFFER_H_BFB0BCB2_DD7C_421B_8BCC_039B98DC0072
3 
4 #include <streambuf>
5 #include <vector>
6 
7 extern "C" {
8 #include <family.h>
9 }
10 
11 class log_buffer : public std::streambuf
12 {
13 public:
14  explicit log_buffer(pCafeParam param, std::size_t buff_sz = 256);
15  virtual ~log_buffer()
16  {
17  sync();
18  }
19 private:
20  int_type overflow(int_type ch);
21  int sync();
22 
23  // copy ctor and assignment not implemented;
24  // copying not allowed
25  log_buffer(const log_buffer &);
26  log_buffer &operator= (const log_buffer &) { return *this; }
27 
28 private:
29  pCafeParam param_;
30  std::vector<char> buffer_;
31 };
32 
33 #endif
virtual ~log_buffer()
Definition: log_buffer.h:15
Definition: log_buffer.h:11
Singleton structure that holds all of the global data that Cafe acts on.
Definition: family.h:115
log_buffer(pCafeParam param, std::size_t buff_sz=256)