IOHandlerCommon.h
Go to the documentation of this file.
/* Frobby: Software for monomial ideal computations.
Copyright (C) 2009 University of Aarhus
Contact Bjarke Hammersholt Roune for license information (www.broune.com)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see http://www.gnu.org/licenses/.
*/
#ifndef IO_HANDLER_COMMON_GUARD
#define IO_HANDLER_COMMON_GUARD
#include "IOHandlerImpl.h"
class Scanner;
class VarNames;
class BigTermConsumer;
class CoefBigTermConsumer;
class InputConsumer;
namespace IO {
class IOHandlerCommon : public IOHandlerImpl {
public:
IOHandlerCommon(const char* formatName,
const char* formatDescription);
void readRing(Scanner& in, VarNames& names);
bool peekRing(Scanner& in);
void readBareIdeal(Scanner& in, InputConsumer& consumer);
void readBarePolynomial(Scanner& in,
const VarNames& names,
CoefBigTermConsumer& consumer);
private:
// The following methods are implemented in terms of the new methods.
virtual void doReadIdeal(Scanner& in, InputConsumer& consumer);
virtual void doReadIdeals(Scanner& in, InputConsumer& consumer);
virtual void doReadPolynomial(Scanner& in, CoefBigTermConsumer& consumer);
// Override these methods except for those that do input
// of un-supported type.
virtual void doReadRing(Scanner& in, VarNames& names) = 0;
virtual bool doPeekRing(Scanner& in) = 0;
virtual void doReadBareIdeal(Scanner& in, InputConsumer& consumer);
virtual void doReadBarePolynomial(Scanner& in,
const VarNames& names,
CoefBigTermConsumer& consumer);
};
}
#endif
IOHandlerImpl.h
BigTermConsumer
Definition BigTermConsumer.h:29
CoefBigTermConsumer
Definition CoefBigTermConsumer.h:29
IO::IOHandlerCommon::readBareIdeal
void readBareIdeal(Scanner &in, InputConsumer &consumer)
Reads an ideal without a ring preceding it.
Definition IOHandlerCommon.cpp:40
IO::IOHandlerCommon::doReadIdeal
virtual void doReadIdeal(Scanner &in, InputConsumer &consumer)
Definition IOHandlerCommon.cpp:50
IO::IOHandlerCommon::doReadRing
virtual void doReadRing(Scanner &in, VarNames &names)=0
IO::IOHandlerCommon::readRing
void readRing(Scanner &in, VarNames &names)
Reads a ring, i.e.
Definition IOHandlerCommon.cpp:32
IO::IOHandlerCommon::doPeekRing
virtual bool doPeekRing(Scanner &in)=0
IO::IOHandlerCommon::doReadPolynomial
virtual void doReadPolynomial(Scanner &in, CoefBigTermConsumer &consumer)
Definition IOHandlerCommon.cpp:74
IO::IOHandlerCommon::doReadBarePolynomial
virtual void doReadBarePolynomial(Scanner &in, const VarNames &names, CoefBigTermConsumer &consumer)
Definition IOHandlerCommon.cpp:81
IO::IOHandlerCommon::IOHandlerCommon
IOHandlerCommon(const char *formatName, const char *formatDescription)
Definition IOHandlerCommon.cpp:27
IO::IOHandlerCommon::doReadIdeals
virtual void doReadIdeals(Scanner &in, InputConsumer &consumer)
Definition IOHandlerCommon.cpp:57
IO::IOHandlerCommon::doReadBareIdeal
virtual void doReadBareIdeal(Scanner &in, InputConsumer &consumer)
Definition IOHandlerCommon.cpp:88
IO::IOHandlerCommon::peekRing
bool peekRing(Scanner &in)
Returns true if what follows in the input is a ring, assuming there are no syntax errors.
Definition IOHandlerCommon.cpp:36
IO::IOHandlerCommon::readBarePolynomial
void readBarePolynomial(Scanner &in, const VarNames &names, CoefBigTermConsumer &consumer)
Reads a polynomial without a ring preceding it.
Definition IOHandlerCommon.cpp:44
IO::IOHandlerImpl::IOHandlerImpl
IOHandlerImpl(const char *formatName, const char *formatDescription)
Definition IOHandlerImpl.cpp:36
InputConsumer
Definition InputConsumer.h:30
Scanner
This class offers an input interface which is more convenient and for some purposes more efficient th...
Definition Scanner.h:50
VarNames
Defines the variables of a polynomial ring and facilities IO involving them.
Definition VarNames.h:40
IO
Definition CoCoA4IOHandler.cpp:33