AlexaClientSDK  1.26.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Public Member Functions | Protected Attributes | List of all members
alexaClientSDK::acsdkInputController::test::MockHandler Class Reference

A Mock for InputControllerHandlerInterface. More...

Inheritance diagram for alexaClientSDK::acsdkInputController::test::MockHandler:
Inheritance graph
[legend]
Collaboration diagram for alexaClientSDK::acsdkInputController::test::MockHandler:
Collaboration graph
[legend]

Public Member Functions

Optional< std::string > waitOnInputChange ()
 
 MockHandler (InputControllerHandlerInterface::InputFriendlyNameType inputConfigs)
 Ctor. More...
 
InputControllerHandlerInterface Functions
InputConfigurations getConfiguration () override
 
bool onInputChange (const std::string &input) override
 
- Public Member Functions inherited from alexaClientSDK::acsdkInputControllerInterfaces::InputControllerHandlerInterface
virtual ~InputControllerHandlerInterface ()=default
 

Protected Attributes

std::mutex m_mutex
 
std::condition_variable m_cond
 
bool m_inputCalled = false
 
std::string m_input
 
InputControllerHandlerInterface::InputFriendlyNameType m_inputsConfig
 

Additional Inherited Members

- Public Types inherited from alexaClientSDK::acsdkInputControllerInterfaces::InputControllerHandlerInterface
using InputFriendlyNameType = std::unordered_map< std::string, std::unordered_set< std::string > >
 

Detailed Description

A Mock for InputControllerHandlerInterface.

Constructor & Destructor Documentation

◆ MockHandler()

alexaClientSDK::acsdkInputController::test::MockHandler::MockHandler ( InputControllerHandlerInterface::InputFriendlyNameType  inputConfigs)
inline

Ctor.

Member Function Documentation

◆ getConfiguration()

InputControllerHandlerInterface::InputConfigurations alexaClientSDK::acsdkInputController::test::MockHandler::getConfiguration ( )
overridevirtual

A function to get the input configuration of the device.

Returns
The InputConfigurations of the device.

Implements alexaClientSDK::acsdkInputControllerInterfaces::InputControllerHandlerInterface.

◆ onInputChange()

bool alexaClientSDK::acsdkInputController::test::MockHandler::onInputChange ( const std::string &  input)
overridevirtual

A callback function to request the change of the input on the device. The InputController does not remember the previous input, so this callback will be called whenever AVS notifies a change in input. Also, during initialization, the application is responsible for remembering the previous input, as the InputController does not notify the application of the previous input with this callback.

Parameters
inputThe selected input on the product. The input is guaranteed to be one of the inputs as specified in the InputConfigurations from getConfiguration().
Returns
A bool indicate if the change in input is successful or not.

Implements alexaClientSDK::acsdkInputControllerInterfaces::InputControllerHandlerInterface.

◆ waitOnInputChange()

Optional< std::string > alexaClientSDK::acsdkInputController::test::MockHandler::waitOnInputChange ( )

Waits for the onInputChange() function to be called.

Returns
An Optional of input. If callback is before timeout, the Optional will be filled with input, otherwise and Empty optional if there was no callback.

Member Data Documentation

◆ m_cond

std::condition_variable alexaClientSDK::acsdkInputController::test::MockHandler::m_cond
protected

◆ m_input

std::string alexaClientSDK::acsdkInputController::test::MockHandler::m_input
protected

◆ m_inputCalled

bool alexaClientSDK::acsdkInputController::test::MockHandler::m_inputCalled = false
protected

◆ m_inputsConfig

InputControllerHandlerInterface::InputFriendlyNameType alexaClientSDK::acsdkInputController::test::MockHandler::m_inputsConfig
protected

◆ m_mutex

std::mutex alexaClientSDK::acsdkInputController::test::MockHandler::m_mutex
protected

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

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