Gromacs  2022.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Classes | Public Member Functions | Friends
gmx::SelectionParserSymbolTable Class Reference

#include <gromacs/selection/symrec.h>

Description

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 SelectionParserSymbolfindSymbol (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.
 

Constructor & Destructor Documentation

gmx::SelectionParserSymbolTable::SelectionParserSymbolTable ( )

Creates a new symbol table.

Exceptions
std::bad_allocif out of memory.

The created table is initialized with reserved and position symbols.

Member Function Documentation

void gmx::SelectionParserSymbolTable::addMethod ( const char *  name,
gmx_ana_selmethod_t method 
)

Adds a new method symbol.

Parameters
[in]nameName of the new symbol.
[in]methodMethod that this symbol represents.
Exceptions
std::bad_allocif out of memory.
APIErrorif there was a symbol with the same name.
void gmx::SelectionParserSymbolTable::addVariable ( const char *  name,
const SelectionTreeElementPointer sel 
)

Adds a new variable symbol.

Parameters
[in]nameName of the new symbol.
[in]selValue of the variable.
Exceptions
std::bad_allocif out of memory.
InvalidInputErrorif 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.

Parameters
[in]typeType of symbols to iterate over.
Returns
Iterator that points to the first symbol of type type.
Exceptions
std::bad_allocif out of memory.
See Also
SelectionParserSymbolIterator
SelectionParserSymbolIterator gmx::SelectionParserSymbolTable::endIterator ( ) const

Returns the end iterator for symbol iteration.

Exceptions
std::bad_allocif out of memory.

Currently, the end value is the same for all symbol types.

See Also
SelectionParserSymbolIterator
const SelectionParserSymbol * gmx::SelectionParserSymbolTable::findSymbol ( const std::string &  name) const

Finds a symbol by name.

Parameters
[in]nameSymbol name to find.
Returns
Pointer to the symbol with name name, or NULL if not found.

Does not throw.


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