SCIP-SDP  2.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ScipStreamBuffer.h
Go to the documentation of this file.
1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2 /* */
3 /* This file is part of SCIPSDP - a solving framework for mixed-integer */
4 /* semidefinite programms based on SCIP. */
5 /* */
6 /* Copyright (C) 2011-2013 Discrete Optimization, TU Darmstadt */
7 /* EDOM, FAU Erlangen-Nürnberg */
8 /* 2014-2016 Discrete Optimization, TU Darmstadt */
9 /* */
10 /* */
11 /* This program is free software; you can redistribute it and/or */
12 /* modify it under the terms of the GNU Lesser General Public License */
13 /* as published by the Free Software Foundation; either version 3 */
14 /* of the License, or (at your option) any later version. */
15 /* */
16 /* This program is distributed in the hope that it will be useful, */
17 /* but WITHOUT ANY WARRANTY; without even the implied warranty of */
18 /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
19 /* GNU Lesser General Public License for more details. */
20 /* */
21 /* You should have received a copy of the GNU Lesser General Public License */
22 /* along with this program; if not, write to the Free Software */
23 /* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.*/
24 /* */
25 /* */
26 /* Based on SCIP - Solving Constraint Integer Programs */
27 /* Copyright (C) 2002-2016 Zuse Institute Berlin */
28 /* SCIP is distributed under the terms of the SCIP Academic Licence, */
29 /* see file COPYING in the SCIP distribution. */
30 /* */
31 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
32 
38 #ifndef SCIPSTREAM_H
39 #define SCIPSTREAM_H
40 
41 #include <streambuf> // for streamsize, streambuf
42 
43 #include <cstddef> // for size_t
44 #include "scip/scip.h"
45 
46 class ScipStreamBuffer : public std::streambuf
47 {
48  public:
49  ScipStreamBuffer(SCIP* scip, SCIP_FILE* file, bool close_on_exit);
50 
52 
53  protected:
55  virtual int underflow();
56 
57  virtual std::streamsize xsgetn(char *dest, std::streamsize request);
58 
59  SCIP* scip_;
60  SCIP_FILE* file_;
61  char* g_buffer_;
62  size_t g_buffer_size_;
64 };
65 #endif
size_t g_buffer_size_
pointer to the get-buffer
virtual int underflow()
the underflow function is responsible for the refilling of the buffer
bool close_on_exit_
size of the get-buffer
ScipStreamBuffer(SCIP *scip, SCIP_FILE *file, bool close_on_exit)
virtual std::streamsize xsgetn(char *dest, std::streamsize request)