InputConsumer Class Reference

`#include <InputConsumer.h>`

## Classes

struct | Entry

## Public Member Functions

| InputConsumer ()
void | consumeRing (const VarNames &names)
void | requireSquareFree ()
void | beginIdeal ()
| Start consuming an ideal.
void | hintGenCount (size_t hintGenCount)
| Suggest that the current ideal will have the given number of generators.
void | beginTerm ()
| Start consuming a term.
size_t | consumeVar (Scanner &in)
| Reads variable and returns id.
size_t | consumeVarNumber (Scanner &in)
| Reads variable as a number so that the first variable is 1.
void | consumeVarExponentOne (size_t var, const Scanner &in)
| Consumes var raised to the exponent 1.
void | consumeVarExponent (size_t var, Scanner &in)
| Consumes var raised to an exponent read from in.
void | endTerm ()
| Done reading a term.
void | consumeTermProductNotation (Scanner &in)
| Reads a term in a format like "a^4*b*c^2".
void | endIdeal ()
| Done reading an ideal.
bool | empty () const
| Returns true if there are ideals stored.
void | releaseIdeal (unique_ptr< SquareFreeIdeal > &sqf, unique_ptr< BigIdeal > &big)
| Struct that keeps either a BigIdeal or a SquareFreeIdeal.
unique_ptr< BigIdeal > | releaseBigIdeal ()
| Returns the least recently read ideal that has not been released.
unique_ptr< SquareFreeIdeal > | releaseSquareFreeIdeal ()
| Returns the least recently read ideal that has not been released.
const VarNames & | getRing () const
| Returns the current ring.

## Private Member Functions

void | releaseIdeal (Entry &e)
void | errorVariableAppearsTwice (const Scanner &in, size_t var)
void | idealNotSquareFree ()

## Static Private Member Functions

static void | toBigIdeal (unique_ptr< SquareFreeIdeal > &sqf, unique_ptr< BigIdeal > &big)

## Private Attributes

string | _tmpString
VarNames | _names
unique_ptr< BigIdeal > | _bigIdeal
unique_ptr< SquareFreeIdeal > | _sqfIdeal
vector< string > | _term
std::list< Entry * > | _ideals
ElementDeleter< std::list< Entry * > > | _idealsDeleter
bool | _inIdeal
bool | _requireSquareFree

## Detailed Description

Definition at line 30 of file InputConsumer.h.

## Constructor & Destructor Documentation

## InputConsumer()

InputConsumer::InputConsumer | ( |  | ) |

Definition at line 27 of file InputConsumer.cpp.

## Member Function Documentation

## beginIdeal()

void InputConsumer::beginIdeal | ( |  | ) |

Start consuming an ideal.

Definition at line 50 of file InputConsumer.cpp.

## beginTerm()

void InputConsumer::beginTerm | ( |  | ) |

Start consuming a term.

Definition at line 62 of file InputConsumer.cpp.

## consumeRing()

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

Definition at line 33 of file InputConsumer.cpp.

## consumeTermProductNotation()

void InputConsumer::consumeTermProductNotation | ( | Scanner & | in | ) |

Reads a term in a format like "a^4*b*c^2".

Definition at line 148 of file InputConsumer.cpp.

## consumeVar()

size_t InputConsumer::consumeVar | ( | Scanner & | in | ) |

Reads variable and returns id.

Does not return if there is an error.

Definition at line 90 of file InputConsumer.cpp.

## consumeVarExponent()

void InputConsumer::consumeVarExponent | ( | size_t | var,
|  | Scanner & | in )

Consumes var raised to an exponent read from in.

Does not return if there is an error.

Definition at line 122 of file InputConsumer.cpp.

## consumeVarExponentOne()

void InputConsumer::consumeVarExponentOne | ( | size_t | var,
|  | const Scanner & | in )

Consumes var raised to the exponent 1.

Definition at line 102 of file InputConsumer.cpp.

## consumeVarNumber()

size_t InputConsumer::consumeVarNumber | ( | Scanner & | in | ) |

Reads variable as a number so that the first variable is 1.

Does not return if there is an error.

Definition at line 76 of file InputConsumer.cpp.

## empty()

bool InputConsumer::empty | ( |  | ) | const

inline

Returns true if there are ideals stored.

Definition at line 74 of file InputConsumer.h.

## endIdeal()

void InputConsumer::endIdeal | ( |  | ) |

Done reading an ideal.

Definition at line 191 of file InputConsumer.cpp.

## endTerm()

void InputConsumer::endTerm | ( |  | ) |

Done reading a term.

Definition at line 164 of file InputConsumer.cpp.

## errorVariableAppearsTwice()

void InputConsumer::errorVariableAppearsTwice | ( | const Scanner & | in,
|  | size_t | var )

private

Definition at line 234 of file InputConsumer.cpp.

## getRing()

const VarNames & InputConsumer::getRing | ( |  | ) | const

inline

Returns the current ring.

Definition at line 91 of file InputConsumer.h.

## hintGenCount()

void InputConsumer::hintGenCount | ( | size_t | hintGenCount | ) |

Suggest that the current ideal will have the given number of generators.

This helps in preallocating the right amount of memory.

Definition at line 57 of file InputConsumer.cpp.

## idealNotSquareFree()

void InputConsumer::idealNotSquareFree | ( |  | ) |

private

Definition at line 241 of file InputConsumer.cpp.

## releaseBigIdeal()

unique_ptr< BigIdeal > InputConsumer::releaseBigIdeal | ( |  | ) |

Returns the least recently read ideal that has not been released.

Converts the ideal to a BigIdeal if it had been read as something else.

Definition at line 209 of file InputConsumer.cpp.

## releaseIdeal() [1/2]

void InputConsumer::releaseIdeal | ( | Entry & | e | ) |

private

Definition at line 227 of file InputConsumer.cpp.

## releaseIdeal() [2/2]

void InputConsumer::releaseIdeal | ( | unique_ptr< SquareFreeIdeal > & | sqf,
|  | unique_ptr< BigIdeal > & | big )

Struct that keeps either a BigIdeal or a SquareFreeIdeal.

Assigns the least recently read ideal that has not been released to the parameter of the type that the ideal was read as.

Definition at line 200 of file InputConsumer.cpp.

## releaseSquareFreeIdeal()

unique_ptr< SquareFreeIdeal > InputConsumer::releaseSquareFreeIdeal | ( |  | ) |

Returns the least recently read ideal that has not been released.

That ideal must have been read as a SquareFreeIdeal.

Definition at line 218 of file InputConsumer.cpp.

## requireSquareFree()

void InputConsumer::requireSquareFree | ( |  | ) |

Definition at line 45 of file InputConsumer.cpp.

## toBigIdeal()

void InputConsumer::toBigIdeal | ( | unique_ptr< SquareFreeIdeal > & | sqf,
|  | unique_ptr< BigIdeal > & | big )

static private

Definition at line 247 of file InputConsumer.cpp.

## Member Data Documentation

## _bigIdeal

unique_ptr<BigIdeal> InputConsumer::_bigIdeal

private

Definition at line 107 of file InputConsumer.h.

## _ideals

std::list<Entry*> InputConsumer::_ideals

private

Definition at line 111 of file InputConsumer.h.

## _idealsDeleter

ElementDeleter<std::list<Entry*> > InputConsumer::_idealsDeleter

private

Definition at line 112 of file InputConsumer.h.

## _inIdeal

bool InputConsumer::_inIdeal

private

Definition at line 113 of file InputConsumer.h.

## _names

VarNames InputConsumer::_names

private

Definition at line 106 of file InputConsumer.h.

## _requireSquareFree

bool InputConsumer::_requireSquareFree

private

Definition at line 114 of file InputConsumer.h.

## _sqfIdeal

unique_ptr<SquareFreeIdeal> InputConsumer::_sqfIdeal

private

Definition at line 108 of file InputConsumer.h.

## _term

vector<string> InputConsumer::_term

private

Definition at line 109 of file InputConsumer.h.

## _tmpString

string InputConsumer::_tmpString

private

Definition at line 105 of file InputConsumer.h.

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

- src/InputConsumer.h
- src/InputConsumer.cpp