Frobby
0.10.0
Toggle main menu visibility
Loading...
Searching...
No Matches
src
TranslatingTermConsumer.h
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
#ifndef TRANSLATING_TERM_CONSUMER_GUARD
18
#define TRANSLATING_TERM_CONSUMER_GUARD
19
20
#include "BigTermConsumer.h"
21
22
class
BigTermConsumer
;
23
class
TermTranslator
;
24
class
VarNames
;
25
class
Term
;
26
27
// The purpose of this class is to replace calls to consume(term) by
28
// consume(term, translator) when term is a Term. Thus untranslated
29
// terms get translated by the translator specified in the translator.
30
class
TranslatingTermConsumer :
public
BigTermConsumer
{
31
public
:
32
// Does not copy the consumer or translator, so they need to remain
33
// valid for the lifetime of this object. Does not take over
34
// ownership of consumer, as is strongly indicated by it being a
35
// reference as opposed to an unique_ptr.
36
TranslatingTermConsumer(
BigTermConsumer
& consumer,
37
const
TermTranslator
& translator);
38
39
// Does not copy the translator, so it needs to remain valid for the
40
// lifetime of this object. Takes over ownership of consumer.
41
TranslatingTermConsumer(unique_ptr<BigTermConsumer> consumer,
42
const
TermTranslator
& translator);
43
44
virtual
void
beginConsumingList
();
45
virtual
void
consumeRing
(
const
VarNames
& names);
46
virtual
void
beginConsuming
();
47
48
virtual
void
consume
(
const
Term
& term);
49
virtual
void
consume
(
const
vector<mpz_class>& term);
50
virtual
void
consume
(
const
Term
& term,
const
TermTranslator
& translator);
51
52
virtual
void
doneConsuming
();
53
virtual
void
doneConsumingList
();
54
55
virtual
void
consume
(
const
BigIdeal
& ideal);
56
57
private
:
58
const
TermTranslator
& _translator;
59
BigTermConsumer
& _consumer;
60
unique_ptr<BigTermConsumer> _consumerOwner;
61
};
62
63
#endif
BigIdeal
Definition
BigIdeal.h:27
BigTermConsumer
Definition
BigTermConsumer.h:29
TermTranslator
Definition
TermTranslator.h:41
Term
Definition
Term.h:49
TranslatingTermConsumer::consumeRing
virtual void consumeRing(const VarNames &names)
Definition
TranslatingTermConsumer.cpp:42
TranslatingTermConsumer::doneConsumingList
virtual void doneConsumingList()
Definition
TranslatingTermConsumer.cpp:69
TranslatingTermConsumer::beginConsuming
virtual void beginConsuming()
Definition
TranslatingTermConsumer.cpp:46
TranslatingTermConsumer::doneConsuming
virtual void doneConsuming()
Definition
TranslatingTermConsumer.cpp:65
TranslatingTermConsumer::consume
virtual void consume(const Term &term)
Definition
TranslatingTermConsumer.cpp:50
TranslatingTermConsumer::beginConsumingList
virtual void beginConsumingList()
Definition
TranslatingTermConsumer.cpp:38
VarNames
Definition
VarNames.h:38
Generated by
1.17.0