Gromacs
2024.4
|
#include <gromacs/topology/symtab.h>
A class to store strings for lookup.
We store the strings in a dedicated object to avoid wrong usage of the flat string vector, and forcing people to use an object that can only be constructed from the transitional StringTableBuilder or filled during file IO.
Note that strings are stripped of trailing and leading whitespace.
Public Member Functions | |
StringTable (gmx::ISerializer *serializer) | |
Constructor used to generate table object from file reading. | |
StringTable (StringTable &&)=default | |
Can move construct. | |
StringTable & | operator= (StringTable &&)=default |
Can move assign. | |
StringTable (const StringTable &)=delete | |
No copy constructor. | |
StringTable & | operator= (const StringTable &)=delete |
No copy assign. | |
StringTableEntry | at (gmx::Index index) const |
Access string at index . More... | |
StringTableEntry | operator[] (gmx::Index index) const |
Bracket operator. | |
void | serializeStringTable (gmx::ISerializer *serializer) |
Handle file IO. | |
void | printStringTableStorageToFile (FILE *fp, int indent, const char *title) const |
Print human readable format of storage. | |
void | copyToLegacySymtab (struct t_symtab *symtab) const |
Copy data in new datastructure to legacy version. More... | |
Friends | |
class | StringTableBuilder |
StringTableEntry StringTable::at | ( | gmx::Index | index | ) | const |
Access string at index
.
On | index being out of range. |
void StringTable::copyToLegacySymtab | ( | struct t_symtab * | symtab | ) | const |
Copy data in new datastructure to legacy version.
The legacy datastructures need to be already initialized.
[in] | symtab | Legacy symbol table to add entries to. |