Frobby  0.9.5
NullIOHandler.cpp
Go to the documentation of this file.
1 /* Frobby: Software for monomial ideal computations.
2  Copyright (C) 2007 Bjarke Hammersholt Roune (www.broune.com)
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, see http://www.gnu.org/licenses/.
16 */
17 #include "stdinc.h"
18 #include "NullIOHandler.h"
19 
20 #include "BigIdeal.h"
21 #include "NullCoefTermConsumer.h"
22 #include "NullTermConsumer.h"
23 #include "BigPolynomial.h"
24 #include "VarNames.h"
25 #include "DataType.h"
26 #include "SatBinomConsumer.h"
27 #include "SatBinomIdeal.h"
28 #include "InputConsumer.h"
29 
30 namespace IO {
32  IOHandlerImpl(staticGetName(),
33  "Ignores input and produces no output.") {
37 
41  }
42 
44  return "null";
45  }
46 
48  return new NullTermConsumer();
49  }
50 
52  return new NullCoefTermConsumer();
53  }
54 
55  void NullIOHandler::doWriteTerm(const vector<mpz_class>& term,
56  const VarNames& names,
57  FILE* out) {
58  }
59 
61  consumer.consumeRing(VarNames());
62  consumer.beginIdeal();
63  consumer.endIdeal();
64  }
65 
67  consumer.consumeRing(VarNames());
68  }
69 
71  consumer.beginTerm();
72  consumer.endTerm();
73  }
74 
76  consumer.consume(BigPolynomial());
77  }
78 
80  consumer.consume(SatBinomIdeal());
81  }
82 
84  return false;
85  }
86 }
virtual void consume(const mpz_class &coef, const Term &term)
static const DataType & getMonomialIdealListType()
Returns the one and only instance for monomial ideal lists.
Definition: DataType.cpp:54
static const DataType & getMonomialIdealType()
Returns the one and only instance for monomial ideals.
Definition: DataType.cpp:45
static const DataType & getPolynomialType()
Returns the one and only instance for polynomials.
Definition: DataType.cpp:50
This class contains a minimum level of functionality that makes it more convenient to derive from tha...
Definition: IOHandlerImpl.h:37
void registerInput(const DataType &type)
Specify that input of the argument type is supported.
void registerOutput(const DataType &type)
Specify that output of the argument type is supported.
virtual void doReadSatBinomIdeal(Scanner &in, SatBinomConsumer &consumer)
virtual BigTermConsumer * doCreateIdealWriter(FILE *out)
virtual void doReadPolynomial(Scanner &in, CoefBigTermConsumer &consumer)
virtual void doReadIdeal(Scanner &in, InputConsumer &consumer)
virtual CoefBigTermConsumer * doCreatePolynomialWriter(FILE *out)
virtual bool doHasMoreInput(Scanner &in) const
static const char * staticGetName()
virtual void doReadIdeals(Scanner &in, InputConsumer &consumer)
virtual void doReadTerm(Scanner &in, InputConsumer &consumer)
virtual void doWriteTerm(const vector< mpz_class > &term, const VarNames &names, FILE *out)
void beginTerm()
Start consuming a term.
void beginIdeal()
Start consuming an ideal.
void consumeRing(const VarNames &names)
void endIdeal()
Done reading an ideal.
void endTerm()
Done reading a term.
This follows the null object pattern.
This follows the null object pattern.
virtual void consume(const vector< mpz_class > &term)=0
Represents a saturated binomial ideal.
Definition: SatBinomIdeal.h:28
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