Page Speed Optimization Libraries
1.13.35.1
|
#include "symbol_table.h"
Public Member Functions | |
void | Clear () |
Atom | Intern (const StringPiece &src) |
Remember a string in the table, returning it as an Atom. | |
size_t | string_bytes_allocated () const |
Implements a generic symbol table, allowing for case-sensitive and case insensitive versions. The elements of SymbolTables are Atoms. Atoms are created by Interning strings.
Atoms are cheap and are passed around by value, not by reference or pointer. Atoms can be compared to one another via ==. A const char* can be extracted from an Atom via ==.
Atoms are memory-managed by the symbol table from which they came. When the symbol table is destroyed, so are all the Atoms that were interned in it.
Care should be taken not to attempt to compare Atoms created from multiple symbol tables.
void net_instaweb::SymbolTable< CharTransform >::Clear | ( | ) |
Remove all symbols in the table, invalidating any Atoms that were previously Interned.
|
inline |
Returns the number of bytes allocated on behalf of the data, excluding any overhead added by the symbol table.