SMTK  @SMTK_VERSION@
Simulation Modeling Tool Kit
Classes | Typedefs | Functions
smtk::string Namespace Reference

A subsystem for efficiently representing strings as fixed-size tokens (hashes). More...

Classes

class  Manager
 The string manager class is a dictionary mapping integers to (constant) string values. More...
 
class  Token
 A string token identified by an integer. More...
 

Typedefs

using Hash = std::size_t
 A fixed-size integer type used to represent an arbitrary-length string.
 

Functions

std::string eventName (const Manager::Event &e)
 A type-conversion operation to cast enumerants to strings.
 
Manager::Event eventEnum (const std::string &e)
 A type-conversion operation to cast strings to event types.
 
std::ostream & operator<< (std::ostream &os, const Manager::Event &e)
 Events may be appended to streams.
 
Token operator""_token (const char *data, std::size_t size)
 Construct a token from a string literal, like so: More...
 

Detailed Description

A subsystem for efficiently representing strings as fixed-size tokens (hashes).

Function Documentation

◆ operator""_token()

Token smtk::string::operator""_token ( const char *  data,
std::size_t  size 
)
inline

Construct a token from a string literal, like so:

{c++}
smtk::string::Token t = """test"""_token
std::cout << t.value() << "\n"; // Prints "test"
smtk::string::Token
A string token identified by an integer.
Definition: Token.h:29