![]() |
AlexaClientSDK
1.26.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
|
#include <MultiTimer.h>
Public Types | |
using | Token = uint64_t |
Alias for the token used to identify a task. This can be used to cancel a task execution. More... | |
Public Member Functions | |
MultiTimer () | |
~MultiTimer () | |
Token | submitTask (const std::chrono::milliseconds &delay, std::function< void()> task) |
void | cancelTask (Token token) |
Static Public Member Functions | |
static std::shared_ptr< MultiTimer > | createMultiTimer () |
A MultiTimer
is used to schedule multiple callable types to run in the future.
using alexaClientSDK::avsCommon::utils::timing::MultiTimer::Token = uint64_t |
Alias for the token used to identify a task. This can be used to cancel a task execution.
alexaClientSDK::avsCommon::utils::timing::MultiTimer::MultiTimer | ( | ) |
Constructor.
alexaClientSDK::avsCommon::utils::timing::MultiTimer::~MultiTimer | ( | ) |
Destructor.
void alexaClientSDK::avsCommon::utils::timing::MultiTimer::cancelTask | ( | Token | token | ) |
Removes a task from the queue.
token | The token used to identify the task to be canceled. |
|
static |
Factory method that creates a shared pointer to a MultiTimer.
MultiTimer::Token alexaClientSDK::avsCommon::utils::timing::MultiTimer::submitTask | ( | const std::chrono::milliseconds & | delay, |
std::function< void()> | task | ||
) |
Submits a task to be executed after a given delay.
This function take longer than the delay due to scheduling or resource contention.
delay | The non-negative time to wait before calling the given task. |
task | The task to be executed. |
AlexaClientSDK 1.26.0 - Copyright 2016-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0