TimedToken
TimedToken
#include <icy/timeout.h>class TimedTokenDefined in src/base/include/icy/timeout.h:95
Inherits:
Timeout
Token that expires after the specified duration.
List of all members
| Name | Kind | Owner |
|---|---|---|
TimedToken | function | Declared here |
TimedToken | function | Declared here |
id | function | Declared here |
operator== | function | Declared here |
operator== | function | Declared here |
_id | variable | Declared here |
Timeout | function | Inherited from Timeout |
Timeout | function | Inherited from Timeout |
Timeout | function | Inherited from Timeout |
~Timeout | function | Inherited from Timeout |
running | function | Inherited from Timeout |
start | function | Inherited from Timeout |
stop | function | Inherited from Timeout |
reset | function | Inherited from Timeout |
remaining | function | Inherited from Timeout |
expired | function | Inherited from Timeout |
setDelay | function | Inherited from Timeout |
delay | function | Inherited from Timeout |
operator= | function | Inherited from Timeout |
operator= | function | Inherited from Timeout |
_startAt | variable | Inherited from Timeout |
_delay | variable | Inherited from Timeout |
_running | variable | Inherited from Timeout |
Inherited from Timeout
| Kind | Name | Description |
|---|---|---|
function | Timeout | Constructs a Timeout with the given delay. |
function | Timeout | Copy constructor. |
function | Timeout noexcept | Defaulted constructor. |
function | ~Timeout | |
function | running const | Returns true if the timer is currently running. |
function | start | Starts (or restarts) the timer, recording the current time as the start point. |
function | stop | Stops the timer without resetting it. expired() will return false after this call. |
function | reset | Restarts the timer from now, equivalent to calling start(). |
function | remaining const | Returns the number of milliseconds remaining before expiry. Returns 0 if already expired, or the full delay if not running. |
function | expired const | Returns true if the timer is running and the delay has fully elapsed. |
function | setDelay inline | Sets the expiry delay without restarting the timer. |
function | delay const inline | Returns the configured delay in milliseconds. |
function | operator= | Copy assignment operator. |
function | operator= noexcept | Defaulted assignment operator. |
variable | _startAt | |
variable | _delay | |
variable | _running |
Public Methods
| 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. |
TimedToken
explicit
explicit TimedToken(long duration = 1000)Defined in src/base/include/icy/timeout.h:101
Constructs a TimedToken with a randomly generated 32-character ID, started immediately with the given duration.
Parameters
durationLifetime in milliseconds (default: 1000).
TimedToken
explicit
explicit TimedToken(const std::string & id, long duration = 1000)Defined in src/base/include/icy/timeout.h:106
Constructs a TimedToken with an explicit ID, started immediately.
Parameters
idToken identifier.durationLifetime in milliseconds (default: 1000).
id
const inline
inline std::string id() constDefined in src/base/include/icy/timeout.h:110
Returns the token's identifier string.
Returns
Token ID.
operator==
const inline
inline bool operator==(const TimedToken & r) constDefined in src/base/include/icy/timeout.h:113
Compares two tokens by ID.
operator==
const inline
inline bool operator==(std::string_view r) constDefined in src/base/include/icy/timeout.h:116
Compares this token's ID against a string.
Protected Attributes
| Return | Name | Description |
|---|---|---|
std::string | _id |
_id
std::string _id