AlexaClientSDK  1.26.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Static Public Member Functions | List of all members
alexaClientSDK::capabilityAgents::system::UserInactivityMonitor Class Reference

This class implements a CapabilityAgent that handles the SetEndpoint directive. More...

#include <UserInactivityMonitor.h>

Inheritance diagram for alexaClientSDK::capabilityAgents::system::UserInactivityMonitor:
Inheritance graph
[legend]
Collaboration diagram for alexaClientSDK::capabilityAgents::system::UserInactivityMonitor:
Collaboration graph
[legend]

Public Member Functions

DirectiveHandlerInterface and CapabilityAgent Functions
avsCommon::avs::DirectiveHandlerConfiguration getConfiguration () const override
 
void handleDirectiveImmediately (std::shared_ptr< avsCommon::avs::AVSDirective > directive) override
 
void preHandleDirective (std::shared_ptr< avsCommon::avs::CapabilityAgent::DirectiveInfo > info) override
 
void handleDirective (std::shared_ptr< avsCommon::avs::CapabilityAgent::DirectiveInfo > info) override
 
void cancelDirective (std::shared_ptr< avsCommon::avs::CapabilityAgent::DirectiveInfo > info) override
 
UserInactivityMonitorInterface functions
void onUserActive () override
 The function to be called when the user has become active. More...
 
std::chrono::seconds timeSinceUserActivity () override
 
void addObserver (std::shared_ptr< avsCommon::sdkInterfaces::UserInactivityMonitorObserverInterface > observer) override
 
void removeObserver (std::shared_ptr< avsCommon::sdkInterfaces::UserInactivityMonitorObserverInterface > observer) override
 
- Public Member Functions inherited from alexaClientSDK::avsCommon::sdkInterfaces::UserInactivityMonitorInterface
virtual ~UserInactivityMonitorInterface ()=default
 Destructor. More...
 
- Public Member Functions inherited from alexaClientSDK::avsCommon::avs::CapabilityAgent
virtual ~CapabilityAgent ()=default
 
void preHandleDirective (std::shared_ptr< AVSDirective > directive, std::unique_ptr< sdkInterfaces::DirectiveHandlerResultInterface > result) override final
 
bool handleDirective (const std::string &messageId) override final
 
void cancelDirective (const std::string &messageId) override final
 
void onDeregistered () override
 
void onFocusChanged (FocusState newFocus, MixingBehavior behavior) override
 
- Public Member Functions inherited from alexaClientSDK::avsCommon::sdkInterfaces::DirectiveHandlerInterface
virtual ~DirectiveHandlerInterface ()=default
 
virtual void handleDirectiveImmediately (std::shared_ptr< avsCommon::avs::AVSDirective > directive)=0
 
virtual void preHandleDirective (std::shared_ptr< avsCommon::avs::AVSDirective > directive, std::unique_ptr< DirectiveHandlerResultInterface > result)=0
 
- Public Member Functions inherited from alexaClientSDK::avsCommon::sdkInterfaces::ChannelObserverInterface
virtual ~ChannelObserverInterface ()=default
 
- Public Member Functions inherited from alexaClientSDK::avsCommon::sdkInterfaces::StateProviderInterface
virtual ~StateProviderInterface ()=default
 
virtual void provideState (const avs::NamespaceAndName &stateProviderName, const ContextRequestToken stateRequestToken)
 
virtual void provideState (const avs::CapabilityTag &stateProviderName, const ContextRequestToken stateRequestToken)
 
virtual bool canStateBeRetrieved ()
 
virtual bool hasReportableStateProperties ()
 
virtual bool shouldQueryState ()
 
- Public Member Functions inherited from alexaClientSDK::avsCommon::sdkInterfaces::ContextRequesterInterface
virtual ~ContextRequesterInterface ()=default
 
virtual void onContextAvailable (const std::string &jsonContext)
 
virtual void onContextAvailable (const endpoints::EndpointIdentifier &endpointId, const avs::AVSContext &endpointContext, ContextRequestToken requestToken)
 
virtual void onContextFailure (const ContextRequestError error)
 
virtual void onContextFailure (const ContextRequestError error, ContextRequestToken token)
 
- Public Member Functions inherited from alexaClientSDK::avsCommon::utils::RequiresShutdown
 RequiresShutdown (const std::string &name)
 
virtual ~RequiresShutdown ()
 Destructor. More...
 
const std::string & name () const
 
void shutdown ()
 
bool isShutdown () const
 

Static Public Member Functions

static std::shared_ptr< avsCommon::sdkInterfaces::UserInactivityMonitorInterfacecreateUserInactivityMonitorInterface (const std::shared_ptr< avsCommon::sdkInterfaces::MessageSenderInterface > &messageSender, const std::shared_ptr< avsCommon::sdkInterfaces::ExceptionEncounteredSenderInterface > &exceptionEncounteredSender, const std::shared_ptr< acsdkShutdownManagerInterfaces::ShutdownNotifierInterface > &shutdownNotifier, const std::shared_ptr< avsCommon::sdkInterfaces::DirectiveSequencerInterface > &directiveSequencer, const std::chrono::milliseconds &sendPeriod=std::chrono::hours(1))
 
static std::shared_ptr< UserInactivityMonitorcreate (std::shared_ptr< avsCommon::sdkInterfaces::MessageSenderInterface > messageSender, std::shared_ptr< avsCommon::sdkInterfaces::ExceptionEncounteredSenderInterface > exceptionEncounteredSender, const std::chrono::milliseconds &sendPeriod=std::chrono::hours(1))
 

Additional Inherited Members

- Protected Member Functions inherited from alexaClientSDK::avsCommon::avs::CapabilityAgent
 CapabilityAgent (const std::string &nameSpace, std::shared_ptr< sdkInterfaces::ExceptionEncounteredSenderInterface > exceptionEncounteredSender)
 
virtual std::shared_ptr< DirectiveInfocreateDirectiveInfo (std::shared_ptr< AVSDirective > directive, std::unique_ptr< sdkInterfaces::DirectiveHandlerResultInterface > result)
 
virtual void preHandleDirective (std::shared_ptr< DirectiveInfo > info)=0
 
virtual void handleDirective (std::shared_ptr< DirectiveInfo > info)=0
 
virtual void cancelDirective (std::shared_ptr< DirectiveInfo > info)=0
 
void removeDirective (const std::string &messageId)
 
void sendExceptionEncounteredAndReportFailed (std::shared_ptr< DirectiveInfo > info, const std::string &message, avsCommon::avs::ExceptionErrorType type=avsCommon::avs::ExceptionErrorType::INTERNAL_ERROR)
 
const std::pair< std::string, std::string > buildJsonEventString (const std::string &eventName, const std::string &dialogRequestIdString="", const std::string &payload="{}", const std::string &context="") const
 
- Protected Attributes inherited from alexaClientSDK::avsCommon::avs::CapabilityAgent
const std::string m_namespace
 The namespace of the capability agent. More...
 
std::shared_ptr< sdkInterfaces::ExceptionEncounteredSenderInterfacem_exceptionEncounteredSender
 Object to use to send exceptionEncountered messages. More...
 

Detailed Description

This class implements a CapabilityAgent that handles the SetEndpoint directive.

Member Function Documentation

◆ addObserver()

void alexaClientSDK::capabilityAgents::system::UserInactivityMonitor::addObserver ( std::shared_ptr< avsCommon::sdkInterfaces::UserInactivityMonitorObserverInterface observer)
overridevirtual

Adds an observer to be notified when the System.UserInactivityReport Event has been sent.

Parameters
observerThe observer to be notified when the System.UserInactivityReport Event has been sent.

Implements alexaClientSDK::avsCommon::sdkInterfaces::UserInactivityMonitorInterface.

◆ cancelDirective()

void alexaClientSDK::capabilityAgents::system::UserInactivityMonitor::cancelDirective ( std::shared_ptr< avsCommon::avs::CapabilityAgent::DirectiveInfo info)
override

◆ create()

std::shared_ptr< UserInactivityMonitor > alexaClientSDK::capabilityAgents::system::UserInactivityMonitor::create ( std::shared_ptr< avsCommon::sdkInterfaces::MessageSenderInterface messageSender,
std::shared_ptr< avsCommon::sdkInterfaces::ExceptionEncounteredSenderInterface exceptionEncounteredSender,
const std::chrono::milliseconds &  sendPeriod = std::chrono::hours(1) 
)
static

Create an instance of UserInactivityMonitor.

Deprecated:
Use createUserInactivityMonitorInterface.
Parameters
messageSenderThe MessageSenderInterface for sending events.
exceptionEncounteredSenderThe interface that sends exceptions.
sendPeriodThe period of send events in seconds.
Returns
nullptr if the inputs are not defined, else a new instance of UserInactivityMonitor.

◆ createUserInactivityMonitorInterface()

std::shared_ptr< avsCommon::sdkInterfaces::UserInactivityMonitorInterface > alexaClientSDK::capabilityAgents::system::UserInactivityMonitor::createUserInactivityMonitorInterface ( const std::shared_ptr< avsCommon::sdkInterfaces::MessageSenderInterface > &  messageSender,
const std::shared_ptr< avsCommon::sdkInterfaces::ExceptionEncounteredSenderInterface > &  exceptionEncounteredSender,
const std::shared_ptr< acsdkShutdownManagerInterfaces::ShutdownNotifierInterface > &  shutdownNotifier,
const std::shared_ptr< avsCommon::sdkInterfaces::DirectiveSequencerInterface > &  directiveSequencer,
const std::chrono::milliseconds &  sendPeriod = std::chrono::hours(1) 
)
static

Create an instance of UserInactivityMonitorInterface.

Parameters
messageSenderThe MessageSenderInterface for sending events.
exceptionEncounteredSenderThe interface that sends exceptions.
shutdownNotifierThe ShutdownNotifierInterface that will notify this instance when it is time to shut down.
directiveSequencerThe DirectiveSequencerInterface with which to register this instance as a directive handler.
sendPeriodThe period of send events in seconds.
Returns
nullptr if the inputs are not defined, else a new instance of UserInactivityMonitor.

◆ getConfiguration()

DirectiveHandlerConfiguration alexaClientSDK::capabilityAgents::system::UserInactivityMonitor::getConfiguration ( ) const
overridevirtual

Returns the configuration of the directive handler.

The configuration consists of multiple directive routing rules and their respective blocking policy. The directives will be matched from the most specific rule (with all fields defined) to the least specific rule (which only matches the directive endpointId).

Returns
The avs::DirectiveHandlerConfiguration of the handler.

Implements alexaClientSDK::avsCommon::sdkInterfaces::DirectiveHandlerInterface.

◆ handleDirective()

void alexaClientSDK::capabilityAgents::system::UserInactivityMonitor::handleDirective ( std::shared_ptr< avsCommon::avs::CapabilityAgent::DirectiveInfo info)
override

◆ handleDirectiveImmediately()

void alexaClientSDK::capabilityAgents::system::UserInactivityMonitor::handleDirectiveImmediately ( std::shared_ptr< avsCommon::avs::AVSDirective directive)
override

◆ onUserActive()

void alexaClientSDK::capabilityAgents::system::UserInactivityMonitor::onUserActive ( )
overridevirtual

The function to be called when the user has become active.

Implements alexaClientSDK::avsCommon::sdkInterfaces::UserInactivityMonitorInterface.

◆ preHandleDirective()

void alexaClientSDK::capabilityAgents::system::UserInactivityMonitor::preHandleDirective ( std::shared_ptr< avsCommon::avs::CapabilityAgent::DirectiveInfo info)
override

◆ removeObserver()

void alexaClientSDK::capabilityAgents::system::UserInactivityMonitor::removeObserver ( std::shared_ptr< avsCommon::sdkInterfaces::UserInactivityMonitorObserverInterface observer)
overridevirtual

Removes an observer from the collection of observers which will be notified when the System.UserInactivityReport Event has been sent.

Parameters
observerThe observer that should no longer be notified when the System.UserInactivityReport Event has been sent.

Implements alexaClientSDK::avsCommon::sdkInterfaces::UserInactivityMonitorInterface.

◆ timeSinceUserActivity()

std::chrono::seconds alexaClientSDK::capabilityAgents::system::UserInactivityMonitor::timeSinceUserActivity ( )
overridevirtual

Calculates how many seconds have elapsed since a user last interacted with the device.

Returns
How many seconds have elapsed since a user last interacted with the device.

Implements alexaClientSDK::avsCommon::sdkInterfaces::UserInactivityMonitorInterface.


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