MPSolve 3.2.1
Loading...
Searching...
No Matches
abstract-input-stream.h
Go to the documentation of this file.
1/*
2 * This file is part of MPSolve 3.2.1
3 *
4 * Copyright (C) 2001-2020, Dipartimento di Matematica "L. Tonelli", Pisa.
5 * License: http://www.gnu.org/licenses/gpl.html GPL version 3 or higher
6 *
7 * Authors:
8 * Leonardo Robol <leonardo.robol@unipi.it>
9 */
10
18#ifndef MPS_ABSTRACT_INPUT_STREAM_H_
19#define MPS_ABSTRACT_INPUT_STREAM_H_
20
21/* C compatibility layer */
22MPS_BEGIN_DECLS
28
33
38 char ** buffer, size_t * length);
39
44
49
50MPS_END_DECLS
51
52/* The following is C++ only */
53#ifdef __cplusplus
54
55namespace mps {
63public:
64
65 virtual ~AbstractInputStream() = 0;
66
73 virtual size_t readline (char ** buffer, size_t * length) = 0;
74
80 virtual bool eof () = 0;
81
87 virtual int getchar () = 0;
88 };
89}
90
91#endif /* __cplusplus */
92
93#endif /* MPS_ABSTRACT_INPUT_STREAM_H_ */
int mps_abstract_input_stream_getchar(mps_abstract_input_stream *stream)
Wrapper around AbstractInputStream::getchar().
Definition: abstract-input-stream.cpp:29
size_t mps_abstract_input_stream_readline(mps_abstract_input_stream *stream, char **buffer, size_t *length)
Wrapper around AbstractInputStream::readline().
Definition: abstract-input-stream.cpp:17
mps_boolean mps_abstract_input_stream_eof(mps_abstract_input_stream *stream)
Wrapper around AbstractInputStream::eof().
Definition: abstract-input-stream.cpp:23
struct mps_abstract_input_stream mps_abstract_input_stream
C wrapper around AbstractInputStream.
Definition: abstract-input-stream.h:32
Abstract class that represent a generic input stream that can be used by MPSolve to read polynomial f...
Definition: abstract-input-stream.h:62
virtual bool eof()=0
Check if we are at the end of the stream.
virtual size_t readline(char **buffer, size_t *length)=0
Return a new line of the stream or NULL if we are at the end.
virtual int getchar()=0
Obtain a single character.