Gromacs
2024.4
|
#include <gromacs/selection/symrec.h>
Symbol table for the selection parser.
Classes | |
class | Impl |
Private implementation class for SelectionParserSymbolTable. More... | |
Public Member Functions | |
SelectionParserSymbolTable () | |
Creates a new symbol table. More... | |
const SelectionParserSymbol * | findSymbol (const std::string &name) const |
Finds a symbol by name. More... | |
SelectionParserSymbolIterator | beginIterator (SelectionParserSymbol::SymbolType type) const |
Returns the start iterator for iterating symbols of a given type. More... | |
SelectionParserSymbolIterator | endIterator () const |
Returns the end iterator for symbol iteration. More... | |
void | addVariable (const char *name, const SelectionTreeElementPointer &sel) |
Adds a new variable symbol. More... | |
void | addMethod (const char *name, gmx_ana_selmethod_t *method) |
Adds a new method symbol. More... | |
Friends | |
class | SelectionParserSymbolIterator |
Needed to access implementation types. | |
gmx::SelectionParserSymbolTable::SelectionParserSymbolTable | ( | ) |
Creates a new symbol table.
std::bad_alloc | if out of memory. |
The created table is initialized with reserved and position symbols.
void gmx::SelectionParserSymbolTable::addMethod | ( | const char * | name, |
gmx_ana_selmethod_t * | method | ||
) |
Adds a new method symbol.
[in] | name | Name of the new symbol. |
[in] | method | Method that this symbol represents. |
std::bad_alloc | if out of memory. |
APIError | if there was a symbol with the same name. |
void gmx::SelectionParserSymbolTable::addVariable | ( | const char * | name, |
const SelectionTreeElementPointer & | sel | ||
) |
Adds a new variable symbol.
[in] | name | Name of the new symbol. |
[in] | sel | Value of the variable. |
std::bad_alloc | if out of memory. |
InvalidInputError | if there was a symbol with the same name. |
SelectionParserSymbolIterator gmx::SelectionParserSymbolTable::beginIterator | ( | SelectionParserSymbol::SymbolType | type | ) | const |
Returns the start iterator for iterating symbols of a given type.
[in] | type | Type of symbols to iterate over. |
type
. std::bad_alloc | if out of memory. |
SelectionParserSymbolIterator gmx::SelectionParserSymbolTable::endIterator | ( | ) | const |
Returns the end iterator for symbol iteration.
std::bad_alloc | if out of memory. |
Currently, the end value is the same for all symbol types.
const SelectionParserSymbol * gmx::SelectionParserSymbolTable::findSymbol | ( | const std::string & | name | ) | const |
Finds a symbol by name.
[in] | name | Symbol name to find. |
name
, or NULL if not found.Does not throw.