AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Classes | Public Member Functions | List of all members
alexaClientSDK::alexaChannelControllerInterfaces::ChannelControllerInterface Class Referenceabstract

#include <ChannelControllerInterface.h>

Inheritance diagram for alexaClientSDK::alexaChannelControllerInterfaces::ChannelControllerInterface:
Inheritance graph
[legend]

Classes

struct  Response
 

Public Member Functions

virtual ~ChannelControllerInterface ()=default
 
virtual Response change (std::unique_ptr< alexaChannelControllerTypes::Channel > channel)=0
 
virtual Response decrementChannel ()=0
 
virtual Response incrementChannel ()=0
 
virtual std::unique_ptr< alexaChannelControllerTypes::ChannelgetCurrentChannel ()=0
 
virtual bool addObserver (std::weak_ptr< ChannelControllerObserverInterface > observer)=0
 
virtual void removeObserver (std::weak_ptr< ChannelControllerObserverInterface > observer)=0
 

Detailed Description

The ChannelControllerInterface carries out channel controller actions such as changing the channel, and skipping (going to the next or previous) channels.

Note
Implementations of this interface must be thread-safe.

Constructor & Destructor Documentation

◆ ~ChannelControllerInterface()

virtual alexaClientSDK::alexaChannelControllerInterfaces::ChannelControllerInterface::~ChannelControllerInterface ( )
virtualdefault

Virtual destructor to assure proper cleanup of derived types.

Member Function Documentation

◆ addObserver()

virtual bool alexaClientSDK::alexaChannelControllerInterfaces::ChannelControllerInterface::addObserver ( std::weak_ptr< ChannelControllerObserverInterface observer)
pure virtual

Adds a ChannelControllerObserverInterface observer.

Note
If ChannelControllerInterface implementation has configured its instance's property as proactively reported, then it is required to notify observers of ChannelControllerObserverInterface for any change in its property state. This includes notifying the value when the device starts, if it is different from the last reported value.
Parameters
observerThe pointer to the ChannelControllerObserverInterface.
Returns
true if the object supports observer notification and observer was successfully added; otherwise, return false

Implemented in alexaClientSDK::alexaChannelController::test::MockAlexaChannelControllerInterface.

◆ change()

virtual Response alexaClientSDK::alexaChannelControllerInterfaces::ChannelControllerInterface::change ( std::unique_ptr< alexaChannelControllerTypes::Channel channel)
pure virtual

Changes the channel on the endpoint.

Parameters
channelThe channel related values such as number, callSign and affiliateCallSign, uri, as well as metadata for the channel like name and image.
Returns
Whether the channel was successfully changed, or if an error was encountered in the process. ChannelControllerInterface::Response.type should return SUCCESS if no errors were encountered. Otherwise, ChannelControllerInterface::Response.type should contain the corresponding error code along with a log message in ChannelControllerInterface::Response.errorMessage.

Implemented in alexaClientSDK::sampleApplications::common::EndpointAlexaChannelControllerHandler.

◆ decrementChannel()

virtual Response alexaClientSDK::alexaChannelControllerInterfaces::ChannelControllerInterface::decrementChannel ( )
pure virtual

Jump to the previous channel on the the endpoint. Decrementing the first channel must wrap to the end of the list.

Returns
Whether the channel was successfully decremented, or if an error was encountered in the process. ChannelControllerInterface::Response.type should return SUCCESS if no errors were encountered. Otherwise, ChannelControllerInterface::Response.type should contain the corresponding error code along with a log message in ChannelControllerInterface::Response.errorMessage.

Implemented in alexaClientSDK::alexaChannelController::test::MockAlexaChannelControllerInterface, and alexaClientSDK::sampleApplications::common::EndpointAlexaChannelControllerHandler.

◆ getCurrentChannel()

virtual std::unique_ptr<alexaChannelControllerTypes::Channel> alexaClientSDK::alexaChannelControllerInterfaces::ChannelControllerInterface::getCurrentChannel ( )
pure virtual

Get the current channel information of the endpoint.

Returns
the current Channel of the endpoint

Implemented in alexaClientSDK::alexaChannelController::test::MockAlexaChannelControllerInterface, and alexaClientSDK::sampleApplications::common::EndpointAlexaChannelControllerHandler.

◆ incrementChannel()

virtual Response alexaClientSDK::alexaChannelControllerInterfaces::ChannelControllerInterface::incrementChannel ( )
pure virtual

Jump to the next channel on the the endpoint. Incrementing the last channel must wrap to the beginning of the list.

Returns
Whether the channel was successfully incremented, or if an error was encountered in the process. ChannelControllerInterface::Response.type should return SUCCESS if no errors were encountered. Otherwise, ChannelControllerInterface::Response.type should contain the corresponding error code along with a log message in ChannelControllerInterface::Response.errorMessage.

Implemented in alexaClientSDK::alexaChannelController::test::MockAlexaChannelControllerInterface, and alexaClientSDK::sampleApplications::common::EndpointAlexaChannelControllerHandler.

◆ removeObserver()

virtual void alexaClientSDK::alexaChannelControllerInterfaces::ChannelControllerInterface::removeObserver ( std::weak_ptr< ChannelControllerObserverInterface observer)
pure virtual

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

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