Frobby
0.9.5
|
Passes consumed items on in a canonical order. More...
#include <CanonicalTermConsumer.h>
Public Member Functions | |
CanonicalTermConsumer (auto_ptr< TermConsumer > consumer, size_t varCount, TermTranslator *translator=0) | |
The translator, if non-null, is used to identify exponents that map to zero, which influences the sorted order. More... | |
virtual void | consumeRing (const VarNames &names) |
Passes on the call immediately. More... | |
virtual void | beginConsumingList () |
This method is not required to be called. More... | |
virtual void | beginConsuming () |
Tell the consumer to begin consuming an ideal. More... | |
virtual void | consume (const Term &term) |
Consume a term. More... | |
virtual void | doneConsuming () |
Must be called once after each time beginConsuming has been called. More... | |
virtual void | doneConsumingList () |
Must be called once after each time beginConsumingList has been called. More... | |
Public Member Functions inherited from TermConsumer | |
virtual | ~TermConsumer () |
void | consume (const Ideal &ideal) |
This is a non-virtual utility method that calls the other methods to achieve its effect of calling beginConsuming, then consuming all generators, and then calling doneConsuming. More... | |
Private Member Functions | |
void | passLastIdeal () |
void | canonicalizeIdeal (Ideal &ideal) |
Private Attributes | |
size_t | _varCount |
bool | _storingList |
vector< Ideal * > | _ideals |
ElementDeleter< vector< Ideal * > > | _idealsDeleter |
auto_ptr< TermConsumer > | _consumer |
TermTranslator * | _translator |
Passes consumed items on in a canonical order.
This requires storing all items before any can be passed on, which can take a lot of memory. The ideals are not minimized, so adding non-minimal generators can have an effect on the sorted order.
Definition at line 32 of file CanonicalTermConsumer.h.
CanonicalTermConsumer::CanonicalTermConsumer | ( | auto_ptr< TermConsumer > | consumer, |
size_t | varCount, | ||
TermTranslator * | translator = 0 |
||
) |
The translator, if non-null, is used to identify exponents that map to zero, which influences the sorted order.
Definition at line 24 of file CanonicalTermConsumer.cpp.
|
virtual |
Tell the consumer to begin consuming an ideal.
It is required to call this method before calling consume().
Implements TermConsumer.
Definition at line 47 of file CanonicalTermConsumer.cpp.
|
virtual |
This method is not required to be called.
If it is called, the list of ideals will be sorted and then passed on. If it is not called, each ideal will be passed on immediately.
Reimplemented from TermConsumer.
Definition at line 40 of file CanonicalTermConsumer.cpp.
|
private |
Definition at line 113 of file CanonicalTermConsumer.cpp.
|
virtual |
|
virtual |
Passes on the call immediately.
Thus the ordering between when this gets called and when consume gets called on the wrapped consumer can be switched around if consumeRing is called while consuming a list of ideals.
Reimplemented from TermConsumer.
Definition at line 36 of file CanonicalTermConsumer.cpp.
|
virtual |
Must be called once after each time beginConsuming has been called.
Implements TermConsumer.
Definition at line 61 of file CanonicalTermConsumer.cpp.
|
virtual |
Must be called once after each time beginConsumingList has been called.
Reimplemented from TermConsumer.
Definition at line 69 of file CanonicalTermConsumer.cpp.
|
private |
Definition at line 92 of file CanonicalTermConsumer.cpp.
|
private |
Definition at line 70 of file CanonicalTermConsumer.h.
|
private |
Definition at line 68 of file CanonicalTermConsumer.h.
|
private |
Definition at line 69 of file CanonicalTermConsumer.h.
|
private |
Definition at line 67 of file CanonicalTermConsumer.h.
|
private |
Definition at line 71 of file CanonicalTermConsumer.h.
|
private |
Definition at line 66 of file CanonicalTermConsumer.h.