#include <icy/timeout.h>Inherits:
Timeout
Token that expires after the specified duration.
| Return | Name | Description |
|---|---|---|
TimedToken explicit | Constructs a TimedToken with a randomly generated 32-character ID, started immediately with the given duration. | |
TimedToken explicit | Constructs a TimedToken with an explicit ID, started immediately. | |
std::string | id const inline | Returns the token's identifier string. |
bool | operator== const inline | Compares two tokens by ID. |
bool | operator== const inline | Compares this token's ID against a string. |
explicit
explicit TimedToken(long duration)Constructs a TimedToken with a randomly generated 32-character ID, started immediately with the given duration.
duration Lifetime in milliseconds (default: 1000).explicit
explicit TimedToken(const std::string & id, long duration)Constructs a TimedToken with an explicit ID, started immediately.
id Token identifier.
duration Lifetime in milliseconds (default: 1000).
const inline
inline std::string id() constReturns the token's identifier string.
Token ID.
const inline
inline bool operator==(const TimedToken & r) constCompares two tokens by ID.
const inline
inline bool operator==(std::string_view r) constCompares this token's ID against a string.
| Return | Name | Description |
|---|---|---|
std::string | _id |
std::string _id