|
Rumba C++ SDK
|
A token is a shared, constant and unique string. More...
#include <Token.h>
Public Member Functions | |
| Token ()=delete | |
| Token (Token &&)=delete | |
| Token & | operator= (Token &&)=delete |
| MAQUINA_EXPORT | Token (const char *s) |
| Build a token using a string. That operation is expensive. More... | |
| Token (const Token &o) | |
| Copy a token, this is fast. More... | |
| Token & | operator= (const Token &o) |
| Copy a token, this is fast. More... | |
| const char * | c_str () const |
| Return a string pointer, this is fast. More... | |
| const std::string & | string () const |
| Return a string object, this is fast. More... | |
| std::string_view | string_view () const |
| Return a string_view object, this is fast. More... | |
| std::size_t | size () const |
| Return the token size, this is fast. More... | |
| std::size_t | hash () const |
| Return a string hash, this is fast. More... | |
| bool | operator== (const Token &o) const |
| Comparisons are fast. More... | |
| bool | operator!= (const Token &o) const |
| bool | operator< (const Token &o) const |
| bool | operator<= (const Token &o) const |
| bool | operator> (const Token &o) const |
| bool | operator>= (const Token &o) const |
Friends | |
| class | TokenManager |
A token is a shared, constant and unique string.
For a given string, a token is unique. All comparisons, including order operators, are done using pointers. A token is small. Creating a token from a raw string is expensive. Comparing tokens is fast. Token comparison operators exists and the order is consistant, but the order itself is undefined. Once crafted, a token is never deleted. Token are thread safe. Most operations are lock free, except the creation of the first token for a given string in a thread.
|
delete |
|
delete |
|
explicit |
Build a token using a string. That operation is expensive.
|
inline |
Copy a token, this is fast.
|
inline |
Return a string pointer, this is fast.
|
inline |
Return a string hash, this is fast.
|
inline |
|
inline |
|
inline |
|
inline |
Comparisons are fast.
|
inline |
|
inline |
|
inline |
Return the token size, this is fast.
|
inline |
Return a string object, this is fast.
|
inline |
Return a string_view object, this is fast.
|
friend |