AlexaClientSDK  1.26.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Public Member Functions | List of all members
alexaClientSDK::avsCommon::utils::threading::WorkerThread Class Reference

#include <WorkerThread.h>

Public Member Functions

 WorkerThread ()
 ~WorkerThread ()
void run (std::function< bool()> workFunc)
void cancel ()
std::string getMoniker () const

Detailed Description

Executes work on a single thread. Stays alive sleeping while there is no work to be done.

Constructor & Destructor Documentation

◆ WorkerThread()

alexaClientSDK::avsCommon::utils::threading::WorkerThread::WorkerThread ( )

Construct a worker thread.

◆ ~WorkerThread()

alexaClientSDK::avsCommon::utils::threading::WorkerThread::~WorkerThread ( )

Destruct a worker thread.

Member Function Documentation

◆ cancel()

void alexaClientSDK::avsCommon::utils::threading::WorkerThread::cancel ( )

Cancel currently running work. If work is not running, the call has no effect.

◆ getMoniker()

std::string alexaClientSDK::avsCommon::utils::threading::WorkerThread::getMoniker ( ) const

Return the moniker for the worker thread.

the worker thread moniker.

◆ run()

void alexaClientSDK::avsCommon::utils::threading::WorkerThread::run ( std::function< bool()>  workFunc)

Perform work on this worker thread until the work is complete or cancel is called.

workFuncthe work function, which shall be called repeatedly while the workFunc returns true or until cancel() is called.

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

AlexaClientSDK 1.26.0 - Copyright 2016-2021, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0