Symmetri
Loading...
Searching...
No Matches
symmetri::Token Class Reference

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>

Inheritance diagram for symmetri::Token:
symmetri::Canceled symmetri::Deadlocked symmetri::Failed symmetri::Paused symmetri::Scheduled symmetri::Started symmetri::Success

Public Member Functions

constexpr const auto & toString () const
 
template<class T>
constexpr bool operator== (const T &t) const
 
constexpr bool operator< (const Token &rhs) const
 
constexpr bool operator> (const Token &rhs) const
 
constexpr int toIndex () const
 returns the unique index for this color.
 
 Token (const char *_id)
 

Static Public Member Functions

static std::vector< const char * > getColors ()
 Get a list of all the colors.
 

Protected Member Functions

constexpr Token (const char *id, const int idx)
 

Protected Attributes

int id
 

Static Protected Attributes

static const size_t kMaxTokenColors
 Maximum amount of different colors.
 
static std::array< const char *, kMaxTokenColorscolors = {nullptr}
 

Detailed Description

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.

Member Function Documentation

◆ getColors()

static std::vector< const char * > symmetri::Token::getColors ( )
inlinestatic

Get a list of all the colors.

Returns
std::vector<const char *>

◆ toIndex()

int symmetri::Token::toIndex ( ) const
inlineconstexpr

returns the unique index for this color.

Returns
constexpr size_t

Member Data Documentation

◆ kMaxTokenColors

const size_t symmetri::Token::kMaxTokenColors
staticprotected
Initial value:
=
100

Maximum amount of different colors.


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