CanonicalTermConsumer Class Reference

Passes consumed items on in a canonical order. More...

`#include <CanonicalTermConsumer.h>`

Inheritance diagram for CanonicalTermConsumer:

## Public Member Functions

| CanonicalTermConsumer (unique_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.
virtual void | consumeRing (const VarNames &names)
| Passes on the call immediately.
virtual void | beginConsumingList ()
| This method is not required to be called.
virtual void | beginConsuming ()
| Tell the consumer to begin consuming an ideal.
virtual void | consume (const Term &term)
| Consume a term.
virtual void | doneConsuming ()
| Must be called once after each time beginConsuming has been called.
virtual void | doneConsumingList ()
| Must be called once after each time beginConsumingList has been called.
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.

## Private Member Functions

void | passLastIdeal ()
void | canonicalizeIdeal (Ideal &ideal)

## Private Attributes

size_t | _varCount
bool | _storingList
vector< Ideal * > | _ideals
ElementDeleter< vector< Ideal * > > | _idealsDeleter
unique_ptr< TermConsumer > | _consumer
TermTranslator * | _translator

## Detailed Description

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.

## Constructor & Destructor Documentation

## CanonicalTermConsumer()

CanonicalTermConsumer::CanonicalTermConsumer | ( | unique_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.

## Member Function Documentation

## beginConsuming()

void CanonicalTermConsumer::beginConsuming | ( |  | ) |

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.

## beginConsumingList()

void CanonicalTermConsumer::beginConsumingList | ( |  | ) |

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.

## canonicalizeIdeal()

void CanonicalTermConsumer::canonicalizeIdeal | ( | Ideal & | ideal | ) |

private

Definition at line 113 of file CanonicalTermConsumer.cpp.

## consume()

void CanonicalTermConsumer::consume | ( | const Term & | term | ) |

virtual

Consume a term.

Implements TermConsumer.

Definition at line 54 of file CanonicalTermConsumer.cpp.

## consumeRing()

void CanonicalTermConsumer::consumeRing | ( | const VarNames & | names | ) |

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.

Todo
  fix this.

Reimplemented from TermConsumer.

Definition at line 36 of file CanonicalTermConsumer.cpp.

## doneConsuming()

void CanonicalTermConsumer::doneConsuming | ( |  | ) |

virtual

Must be called once after each time beginConsuming has been called.

Implements TermConsumer.

Definition at line 61 of file CanonicalTermConsumer.cpp.

## doneConsumingList()

void CanonicalTermConsumer::doneConsumingList | ( |  | ) |

virtual

Must be called once after each time beginConsumingList has been called.

Reimplemented from TermConsumer.

Definition at line 69 of file CanonicalTermConsumer.cpp.

## passLastIdeal()

void CanonicalTermConsumer::passLastIdeal | ( |  | ) |

private

Definition at line 92 of file CanonicalTermConsumer.cpp.

## Member Data Documentation

## _consumer

unique_ptr<TermConsumer> CanonicalTermConsumer::_consumer

private

Definition at line 70 of file CanonicalTermConsumer.h.

## _ideals

vector<Ideal*> CanonicalTermConsumer::_ideals

private

Definition at line 68 of file CanonicalTermConsumer.h.

## _idealsDeleter

ElementDeleter<vector<Ideal*> > CanonicalTermConsumer::_idealsDeleter

private

Definition at line 69 of file CanonicalTermConsumer.h.

## _storingList

bool CanonicalTermConsumer::_storingList

private

Definition at line 67 of file CanonicalTermConsumer.h.

## _translator

TermTranslator* CanonicalTermConsumer::_translator

private

Definition at line 71 of file CanonicalTermConsumer.h.

## _varCount

size_t CanonicalTermConsumer::_varCount

private

Definition at line 66 of file CanonicalTermConsumer.h.

The documentation for this class was generated from the following files:

- src/CanonicalTermConsumer.h
- src/CanonicalTermConsumer.cpp