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

#include <gromacs/topology/symtab.h>

Description

Builds a memory efficient storage for strings of characters.

Allows storing strings of characters with unique entries.

Public Member Functions

StringTableEntry addString (const std::string &theString)
 Place new unique string in storage object. More...
 
int findEntryByName (const std::string &name) const
 Find matching entry in storage by name as string.
 
StringTable build ()
 Build the StringTable from the internal map of strings. More...
 

Member Function Documentation

StringTableEntry StringTableBuilder::addString ( const std::string &  theString)

Place new unique string in storage object.

Enters new string into the underlying storage or recovers existing entry.

Parameters
[in]theStringNew string to enter.
Returns
New entry object with reference to string and index into storage. The reference is only valid while the builder is in use, and becomes invalidated when generating the StringTable.
StringTable StringTableBuilder::build ( )

Build the StringTable from the internal map of strings.

The unique indices returned from addString() can be used to index into the returned StringTable. Clears the temporary storage so that the StringTableBuilder can be re-used to build a distinct StringTable.


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