Tokens are elements that can reside in places. Tokens can have a color which makes them distinguishable from other tokens. Tokens that have the same color are not distinguishable. Users can create their own token-colors by either using the CREATE_CUSTOM_TOKEN-macro (compile-time) or by calling Token's public constructor which takes a token-name.
More...
#include <colors.hpp>
|
| Token (const char *s) |
| Construct a new Token object from a string at run-time. A unique id is generated and if it fails it will exit the application through a failing assert.
|
|
constexpr bool | operator< (const Token &rhs) const |
|
constexpr bool | operator> (const Token &rhs) const |
|
constexpr size_t | toIndex () const |
| returns the unique index for this color.
|
|
constexpr const auto & | toString () const |
| returns the string-representation for this color.
|
|
constexpr bool | operator== (const Token &c) const |
|
template<class T > |
constexpr bool | operator== (const T &) const |
|
|
static std::vector< std::string_view > | getColors () |
| Get a list of all the colors.
|
|
|
template<class T > |
constexpr | Token (T *const) |
| Creates a Token with a unique numerical id and a string representation based on the name of the argument-type at compile-time.
|
|
Tokens are elements that can reside in places. Tokens can have a color which makes them distinguishable from other tokens. Tokens that have the same color are not distinguishable. Users can create their own token-colors by either using the CREATE_CUSTOM_TOKEN-macro (compile-time) or by calling Token's public constructor which takes a token-name.
◆ Token() [1/2]
template<class T >
symmetri::Token::Token |
( |
T * const | | ) |
|
|
inlineconstexprprotected |
Creates a Token with a unique numerical id and a string representation based on the name of the argument-type at compile-time.
- Template Parameters
-
T | the type representing the token-color |
◆ Token() [2/2]
symmetri::Token::Token |
( |
const char * | s | ) |
|
|
inline |
Construct a new Token object from a string at run-time. A unique id is generated and if it fails it will exit the application through a failing assert.
- Parameters
-
s | string-representation of the color |
◆ getColors()
static std::vector< std::string_view > symmetri::Token::getColors |
( |
| ) |
|
|
inlinestatic |
Get a list of all the colors.
- Returns
- std::vector<std::string_view>
◆ toIndex()
size_t symmetri::Token::toIndex |
( |
| ) |
const |
|
inlineconstexpr |
returns the unique index for this color.
- Returns
- constexpr size_t
◆ toString()
const auto & symmetri::Token::toString |
( |
| ) |
const |
|
inlineconstexpr |
returns the string-representation for this color.
- Returns
- constexpr const auto&
The documentation for this class was generated from the following file: