Frobby 0.9.5
IOHandlerCommon.h
Go to the documentation of this file.
1/* Frobby: Software for monomial ideal computations.
2 Copyright (C) 2009 University of Aarhus
3 Contact Bjarke Hammersholt Roune for license information (www.broune.com)
4
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see http://www.gnu.org/licenses/.
17*/
18#ifndef IO_HANDLER_COMMON_GUARD
19#define IO_HANDLER_COMMON_GUARD
20
21#include "IOHandlerImpl.h"
22
23class Scanner;
24class VarNames;
25class BigTermConsumer;
27class InputConsumer;
28
29namespace IO {
34 public:
35 IOHandlerCommon(const char* formatName,
36 const char* formatDescription);
37
39 void readRing(Scanner& in, VarNames& names);
40
43 bool peekRing(Scanner& in);
44
46 void readBareIdeal(Scanner& in, InputConsumer& consumer);
47
50 const VarNames& names,
51 CoefBigTermConsumer& consumer);
52
53 private:
54 // The following methods are implemented in terms of the new methods.
55 virtual void doReadIdeal(Scanner& in, InputConsumer& consumer);
56 virtual void doReadIdeals(Scanner& in, InputConsumer& consumer);
57 virtual void doReadPolynomial(Scanner& in, CoefBigTermConsumer& consumer);
58
59 // Override these methods except for those that do input
60 // of un-supported type.
61 virtual void doReadRing(Scanner& in, VarNames& names) = 0;
62 virtual bool doPeekRing(Scanner& in) = 0;
63 virtual void doReadBareIdeal(Scanner& in, InputConsumer& consumer);
64 virtual void doReadBarePolynomial(Scanner& in,
65 const VarNames& names,
66 CoefBigTermConsumer& consumer);
67 };
68}
69
70#endif
This class contains further functionality that makes it more convenient to derive from than IOHandler...
void readBareIdeal(Scanner &in, InputConsumer &consumer)
Reads an ideal without a ring preceding it.
virtual void doReadIdeal(Scanner &in, InputConsumer &consumer)
virtual void doReadRing(Scanner &in, VarNames &names)=0
void readRing(Scanner &in, VarNames &names)
Reads a ring, i.e.
virtual bool doPeekRing(Scanner &in)=0
virtual void doReadPolynomial(Scanner &in, CoefBigTermConsumer &consumer)
virtual void doReadBarePolynomial(Scanner &in, const VarNames &names, CoefBigTermConsumer &consumer)
IOHandlerCommon(const char *formatName, const char *formatDescription)
virtual void doReadIdeals(Scanner &in, InputConsumer &consumer)
virtual void doReadBareIdeal(Scanner &in, InputConsumer &consumer)
bool peekRing(Scanner &in)
Returns true if what follows in the input is a ring, assuming there are no syntax errors.
void readBarePolynomial(Scanner &in, const VarNames &names, CoefBigTermConsumer &consumer)
Reads a polynomial without a ring preceding it.
This class contains a minimum level of functionality that makes it more convenient to derive from tha...
Definition: IOHandlerImpl.h:37
This class offers an input interface which is more convenient and for some purposes more efficient th...
Definition: Scanner.h:50
Defines the variables of a polynomial ring and facilities IO involving them.
Definition: VarNames.h:40