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

#include <TestableMessageObserver.h>

Inheritance diagram for alexaClientSDK::avsCommon::utils::TestableMessageObserver:
Inheritance graph
[legend]
Collaboration diagram for alexaClientSDK::avsCommon::utils::TestableMessageObserver:
Collaboration graph
[legend]

Public Member Functions

void receive (const std::string &contextId, const std::string &message) override
 
bool waitForDirective (const std::string &directiveMessage, const std::chrono::seconds duration)
 
- Public Member Functions inherited from alexaClientSDK::avsCommon::sdkInterfaces::MessageObserverInterface
virtual ~MessageObserverInterface ()=default
 

Detailed Description

A useful class that allows us to test a Directive being received.

Member Function Documentation

◆ receive()

void alexaClientSDK::avsCommon::utils::TestableMessageObserver::receive ( const std::string &  contextId,
const std::string &  message 
)
overridevirtual

A function that a client must implement to receive Messages from AVS.

Parameters
contextIdThe context for the message, which in this case reflects the logical HTTP/2 stream the message arrived on.
messageThe AVS message that has been received.

Implements alexaClientSDK::avsCommon::sdkInterfaces::MessageObserverInterface.

◆ waitForDirective()

bool alexaClientSDK::avsCommon::utils::TestableMessageObserver::waitForDirective ( const std::string &  directiveMessage,
const std::chrono::seconds  duration 
)

A function to wait for a specific directive to be received.

Parameters
directiveMessageThe text of the directive.
duratonThe maximum time the caller should wait for this to occur.
Returns
Whether the directive was received ok within the timeout.

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

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