Gromacs  2024.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Member Functions
StringTable Class Reference

#include <gromacs/topology/symtab.h>

Description

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.
 
StringTableoperator= (StringTable &&)=default
 Can move assign.
 
 StringTable (const StringTable &)=delete
 No copy constructor.
 
StringTableoperator= (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...
 

Member Function Documentation

StringTableEntry StringTable::at ( gmx::Index  index) const

Access string at index.

Returns
Entry type that constains both the string and the index, with the index needed during (de-)serialization.
Exceptions
Onindex 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.

Parameters
[in]symtabLegacy symbol table to add entries to.

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