UnCoVer (Using Coverability for Verification)
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
MultiStreamBuffer.h
1 /***************************************************************************
2  * Copyright (C) 2015 by Jan Stückrath <jan.stueckrath@uni-due.de> *
3  * *
4  * This program is free software; you can redistribute it and/or modify *
5  * it under the terms of the GNU General Public License as published by *
6  * the Free Software Foundation; either version 2 of the License, or *
7  * (at your option) any later version. *
8  * *
9  * This program is distributed in the hope that it will be useful, *
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12  * GNU General Public License for more details. *
13  * *
14  * You should have received a copy of the GNU General Public License *
15  * along with this program; if not, write to the *
16  * Free Software Foundation, Inc., *
17  * 51 Franklin St, Fifth Floor, Boston, MA 02110, USA *
18  ***************************************************************************/
19 
20 #ifndef MULTISTREAMBUFFER_H_
21 #define MULTISTREAMBUFFER_H_
22 
23 #include <streambuf>
24 #include <vector>
25 
26 // TODO comment this class
27 
28 namespace uncover {
29  namespace logging {
30 
31  class MultiStreamBuffer : public std::streambuf {
32 
33  friend class MultiStream;
34 
35  public:
36 
38 
39  virtual ~MultiStreamBuffer();
40 
41  protected:
42 
43  virtual int overflow(int c) override;
44 
45  virtual int sync() override;
46 
47  void addBuffer(std::streambuf* buffer);
48 
49  size_t removeBuffer(std::streambuf* buffer);
50 
51  private:
52 
53  std::vector<std::streambuf*> buffers;
54 
55  };
56 
57 
58  } /* namespace logging */
59 } /* namespace uncover */
60 
61 #endif /* MULTISTREAMBUFFER_H_ */
Definition: MultiStreamBuffer.h:31
Definition: MultiStream.h:32