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

Minimal implementation of a message observer for integration tests. More...

#include <ClientMessageHandler.h>

Inheritance diagram for alexaClientSDK::integration::ClientMessageHandler:
Inheritance graph
[legend]
Collaboration diagram for alexaClientSDK::integration::ClientMessageHandler:
Collaboration graph
[legend]

Public Member Functions

 ClientMessageHandler (std::shared_ptr< avsCommon::avs::attachment::AttachmentManager > attachmentManager)
 Constructor. More...
 
void receive (const std::string &contextId, const std::string &message) override
 
bool waitForNext (const std::chrono::seconds duration=std::chrono::seconds(2))
 
- Public Member Functions inherited from alexaClientSDK::avsCommon::sdkInterfaces::MessageObserverInterface
virtual ~MessageObserverInterface ()=default
 

Detailed Description

Minimal implementation of a message observer for integration tests.

Constructor & Destructor Documentation

◆ ClientMessageHandler()

alexaClientSDK::integration::ClientMessageHandler::ClientMessageHandler ( std::shared_ptr< avsCommon::avs::attachment::AttachmentManager attachmentManager)

Constructor.

Member Function Documentation

◆ receive()

void alexaClientSDK::integration::ClientMessageHandler::receive ( const std::string &  contextId,
const std::string &  message 
)
overridevirtual

Implementation of the interface's receive function.

For the purposes of these integration tests, this function simply logs and counts messages.

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

◆ waitForNext()

bool alexaClientSDK::integration::ClientMessageHandler::waitForNext ( const std::chrono::seconds  duration = std::chrono::seconds(2))

Wait for a message to be received.

This function waits for a specified number of seconds for a message to arrive.

Parameters
durationNumber of seconds to wait before giving up.
Returns
true if a message was received within the specified duration, else false.

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

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