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

#include <SynchronizedMessageRequestQueue.h>

Inheritance diagram for alexaClientSDK::acl::SynchronizedMessageRequestQueue:
Inheritance graph
[legend]
Collaboration diagram for alexaClientSDK::acl::SynchronizedMessageRequestQueue:
Collaboration graph
[legend]

Public Member Functions

 SynchronizedMessageRequestQueue ()=default
 
 ~SynchronizedMessageRequestQueue () override
 
void enqueueRequest (std::shared_ptr< avsCommon::avs::MessageRequest > messageRequest) override
 
avsCommon::utils::Optional< std::chrono::time_point< std::chrono::steady_clock > > peekRequestTime () override
 
std::shared_ptr< avsCommon::avs::MessageRequestdequeueOldestRequest () override
 
std::shared_ptr< avsCommon::avs::MessageRequestdequeueSendableRequest () override
 
bool isMessageRequestAvailable () const override
 
void setWaitingForSendAcknowledgement () override
 
void clearWaitingForSendAcknowledgement () override
 
bool empty () const override
 
void clear () override
 
- Public Member Functions inherited from alexaClientSDK::acl::MessageRequestQueueInterface
virtual ~MessageRequestQueueInterface ()=default
 

Detailed Description

Class to manage MessageRequest send queue that is shared between instances of HTTP2Transport.

Constructor & Destructor Documentation

◆ SynchronizedMessageRequestQueue()

alexaClientSDK::acl::SynchronizedMessageRequestQueue::SynchronizedMessageRequestQueue ( )
default

Constructor.

◆ ~SynchronizedMessageRequestQueue()

alexaClientSDK::acl::SynchronizedMessageRequestQueue::~SynchronizedMessageRequestQueue ( )
override

Destructor.

Member Function Documentation

◆ clear()

void alexaClientSDK::acl::SynchronizedMessageRequestQueue::clear ( )
overridevirtual

Clears all queue of MessageRequests.

Implements alexaClientSDK::acl::MessageRequestQueueInterface.

◆ clearWaitingForSendAcknowledgement()

void alexaClientSDK::acl::SynchronizedMessageRequestQueue::clearWaitingForSendAcknowledgement ( )
overridevirtual

Clear the flag indicating that the queue is waiting for a send to be acknowledged.

Implements alexaClientSDK::acl::MessageRequestQueueInterface.

◆ dequeueOldestRequest()

std::shared_ptr< MessageRequest > alexaClientSDK::acl::SynchronizedMessageRequestQueue::dequeueOldestRequest ( )
overridevirtual

Dequeues the oldest MessageRequest regardless of whether or not the queue is waiting for a response.

Returns
MessageRequest if available, else return nullptr.

Implements alexaClientSDK::acl::MessageRequestQueueInterface.

◆ dequeueSendableRequest()

std::shared_ptr< MessageRequest > alexaClientSDK::acl::SynchronizedMessageRequestQueue::dequeueSendableRequest ( )
overridevirtual

Dequeues the next available MessageRequest taking into account if the queue is waiting for a response to a previously sent message and if any messages that do not care about sequencing are in the queue.

Returns
MessageRequest if available, else return nullptr.

Implements alexaClientSDK::acl::MessageRequestQueueInterface.

◆ empty()

bool alexaClientSDK::acl::SynchronizedMessageRequestQueue::empty ( ) const
overridevirtual

Checks if there are any queued MessageRequests.

Returns
true if there are no messageRequests in the queue, else false.

Implements alexaClientSDK::acl::MessageRequestQueueInterface.

◆ enqueueRequest()

void alexaClientSDK::acl::SynchronizedMessageRequestQueue::enqueueRequest ( std::shared_ptr< avsCommon::avs::MessageRequest messageRequest)
overridevirtual

◆ isMessageRequestAvailable()

bool alexaClientSDK::acl::SynchronizedMessageRequestQueue::isMessageRequestAvailable ( ) const
overridevirtual

This method checks if there is a MessageRequest available to be sent.

Returns
true if MessageRequest is available to be sent, else false.

Implements alexaClientSDK::acl::MessageRequestQueueInterface.

◆ peekRequestTime()

avsCommon::utils::Optional< std::chrono::time_point< std::chrono::steady_clock > > alexaClientSDK::acl::SynchronizedMessageRequestQueue::peekRequestTime ( )
overridevirtual

Peek at the next item in the queue and retrieve the time that the request was queued.

Returns
The time that the next request (if any) was queued.

Implements alexaClientSDK::acl::MessageRequestQueueInterface.

◆ setWaitingForSendAcknowledgement()

void alexaClientSDK::acl::SynchronizedMessageRequestQueue::setWaitingForSendAcknowledgement ( )
overridevirtual

Sets the flag indicating that the queue is waiting for a send to be acknowledged.

Implements alexaClientSDK::acl::MessageRequestQueueInterface.


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