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

#include <AbstractAVSConnectionManager.h>

Inheritance diagram for alexaClientSDK::avsCommon::avs::AbstractAVSConnectionManager:
Inheritance graph
[legend]
Collaboration diagram for alexaClientSDK::avsCommon::avs::AbstractAVSConnectionManager:
Collaboration graph
[legend]

Public Types

using ConnectionStatusObserverInterface = avsCommon::sdkInterfaces::ConnectionStatusObserverInterface
 Type alias for brevity. More...
 
- Public Types inherited from alexaClientSDK::avsCommon::sdkInterfaces::AVSConnectionManagerInterface
using ConnectionStatusObserverInterface = avsCommon::sdkInterfaces::ConnectionStatusObserverInterface
 Type alias for brevity. More...
 

Public Member Functions

 AbstractAVSConnectionManager (std::unordered_set< std::shared_ptr< ConnectionStatusObserverInterface >> observers=std::unordered_set< std::shared_ptr< ConnectionStatusObserverInterface >>())
 
virtual ~AbstractAVSConnectionManager ()=default
 
AVSConnectionManagerInterface method overrides.
void addConnectionStatusObserver (std::shared_ptr< ConnectionStatusObserverInterface > observer) override
 
void removeConnectionStatusObserver (std::shared_ptr< ConnectionStatusObserverInterface > observer) override
 
- Public Member Functions inherited from alexaClientSDK::avsCommon::sdkInterfaces::AVSConnectionManagerInterface
virtual ~AVSConnectionManagerInterface ()=default
 
virtual void enable ()=0
 
virtual void disable ()=0
 
virtual bool isEnabled ()=0
 
virtual void reconnect ()=0
 
virtual bool isConnected () const =0
 
virtual void onWakeConnectionRetry ()=0
 
virtual void addMessageObserver (std::shared_ptr< avsCommon::sdkInterfaces::MessageObserverInterface > observer)=0
 
virtual void removeMessageObserver (std::shared_ptr< avsCommon::sdkInterfaces::MessageObserverInterface > observer)=0
 
virtual void addConnectionStatusObserver (std::shared_ptr< ConnectionStatusObserverInterface > observer)=0
 
virtual void removeConnectionStatusObserver (std::shared_ptr< ConnectionStatusObserverInterface > observer)=0
 
- Public Member Functions inherited from alexaClientSDK::avsCommon::sdkInterfaces::MessageSenderInterface
virtual ~MessageSenderInterface ()=default
 Destructor. More...
 
virtual void sendMessage (std::shared_ptr< avs::MessageRequest > request)=0
 
- Public Member Functions inherited from alexaClientSDK::avsCommon::sdkInterfaces::AVSGatewayAssignerInterface
virtual ~AVSGatewayAssignerInterface ()=default
 Destructor. More...
 
virtual void setAVSGateway (const std::string &avsGateway)=0
 
virtual std::string getAVSGateway () const =0
 

Protected Member Functions

void updateConnectionStatus (ConnectionStatusObserverInterface::Status status, const std::vector< avsCommon::sdkInterfaces::ConnectionStatusObserverInterface::EngineConnectionStatus > &engineConnectionStatuses)
 
void notifyObservers (bool avsConnectionStatusChanged)
 
void clearObservers ()
 

Protected Attributes

std::mutex m_mutex
 Mutex to protect access to data members. More...
 
ConnectionStatusObserverInterface::Status m_connectionStatus
 The current connection status. m_mutex must be acquired before access. More...
 
ConnectionStatusObserverInterface::Status m_avsConnectionStatus
 
std::vector< ConnectionStatusObserverInterface::EngineConnectionStatusm_engineConnectionStatuses
 The detailed connection statuses for each engine. More...
 
std::unordered_set< std::shared_ptr< ConnectionStatusObserverInterface > > m_connectionStatusObservers
 Set of observers to notify when the connection status changes. m_mutex must be acquired before access. More...
 

Detailed Description

This class provides a partial implementation of the AVSConnectionManagerInterface.

Member Typedef Documentation

◆ ConnectionStatusObserverInterface

Type alias for brevity.

Constructor & Destructor Documentation

◆ AbstractAVSConnectionManager()

alexaClientSDK::avsCommon::avs::AbstractAVSConnectionManager::AbstractAVSConnectionManager ( std::unordered_set< std::shared_ptr< ConnectionStatusObserverInterface >>  observers = std::unordered_set<std::shared_ptr<ConnectionStatusObserverInterface>>())

Constructor.

◆ ~AbstractAVSConnectionManager()

virtual alexaClientSDK::avsCommon::avs::AbstractAVSConnectionManager::~AbstractAVSConnectionManager ( )
virtualdefault

Destructor.

Member Function Documentation

◆ addConnectionStatusObserver()

void alexaClientSDK::avsCommon::avs::AbstractAVSConnectionManager::addConnectionStatusObserver ( std::shared_ptr< ConnectionStatusObserverInterface observer)
override

◆ clearObservers()

void alexaClientSDK::avsCommon::avs::AbstractAVSConnectionManager::clearObservers ( )
protected

Removes all observers registered for Connection status notifications.

◆ notifyObservers()

void alexaClientSDK::avsCommon::avs::AbstractAVSConnectionManager::notifyObservers ( bool  avsConnectionStatusChanged)
protected

Utility function to notify all observers of the current Connection Status of engines.

Parameters
avsConnectionStatusChangedvalue to indicate if default status changed or not

◆ removeConnectionStatusObserver()

void alexaClientSDK::avsCommon::avs::AbstractAVSConnectionManager::removeConnectionStatusObserver ( std::shared_ptr< ConnectionStatusObserverInterface observer)
override

◆ updateConnectionStatus()

void alexaClientSDK::avsCommon::avs::AbstractAVSConnectionManager::updateConnectionStatus ( ConnectionStatusObserverInterface::Status  status,
const std::vector< avsCommon::sdkInterfaces::ConnectionStatusObserverInterface::EngineConnectionStatus > &  engineConnectionStatuses 
)
protected

Utility function to update our local status variables.

Parameters
statusThe Connection Status.
engineConnectionStatusesThe detailed connection status for each engine.

Member Data Documentation

◆ m_avsConnectionStatus

ConnectionStatusObserverInterface::Status alexaClientSDK::avsCommon::avs::AbstractAVSConnectionManager::m_avsConnectionStatus
protected

The current Alexa Voice Services connection status. TODO STAR-562: once migrate to use new onConnectionStatusChange API, this member variable should be removed.

◆ m_connectionStatus

ConnectionStatusObserverInterface::Status alexaClientSDK::avsCommon::avs::AbstractAVSConnectionManager::m_connectionStatus
protected

The current connection status. m_mutex must be acquired before access.

◆ m_connectionStatusObservers

std::unordered_set<std::shared_ptr<ConnectionStatusObserverInterface> > alexaClientSDK::avsCommon::avs::AbstractAVSConnectionManager::m_connectionStatusObservers
protected

Set of observers to notify when the connection status changes. m_mutex must be acquired before access.

◆ m_engineConnectionStatuses

std::vector<ConnectionStatusObserverInterface::EngineConnectionStatus> alexaClientSDK::avsCommon::avs::AbstractAVSConnectionManager::m_engineConnectionStatuses
protected

The detailed connection statuses for each engine.

◆ m_mutex

std::mutex alexaClientSDK::avsCommon::avs::AbstractAVSConnectionManager::m_mutex
protected

Mutex to protect access to data members.


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

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