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

#include <gromacs/topology/symtab.h>

Description

Helper class to access members in StringTable.

This class is a wrapper around a string reference to access the actual entry in the table, as well as an index used for serializing the datastructure.

This also provides efficient comparison calls between different entries.

Public Member Functions

 StringTableEntry (const StringTableEntry &)=default
 Copy construct.
 
 StringTableEntry (StringTableEntry &&) noexcept=default
 Move construct.
 
StringTableEntryoperator= (const StringTableEntry &)=default
 Copy assign.
 
StringTableEntryoperator= (StringTableEntry &&)=default
 Move assign.
 
bool operator== (const StringTableEntry &o) const
 Compare entries by indices. Same string should always have same index.
 
bool operator!= (const StringTableEntry &o) const
 Unequal comparison.
 
const std::string & operator* () const
 Access to underlying view.
 
const std::string * operator-> () const
 Access to underlying view.
 
void serialize (gmx::ISerializer *serializer) const
 Serialize index.
 

Friends

StringTableEntry readStringTableEntry (gmx::ISerializer *serializer, const StringTable &table)
 De-serialize StringTableEntry using the index into the table. More...
 

Friends And Related Function Documentation

StringTableEntry readStringTableEntry ( gmx::ISerializer *  serializer,
const StringTable table 
)
friend

De-serialize StringTableEntry using the index into the table.

Parameters
[in]serializerThe object containing the serialized index.
[in]tableThe storage object holding all strings.
Returns
The entry into the Table as StringTableEntry.

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