AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Namespaces | Classes | Typedefs | Enumerations | Functions
alexaClientSDK::avsCommon::utils::sds Namespace Reference

Namespaces

 SharedDataStream
 
 test
 

Classes

struct  InProcessSDSTraits
 Structure for specifying the traits of a SharedDataStream which works between threads in a single process. More...
 

Typedefs

using InProcessSDS = SharedDataStream< InProcessSDSTraits >
 Type alias for a SharedDataStream which works between threads in a single process. More...
 

Enumerations

enum  ReaderPolicy { ReaderPolicy::NONBLOCKING, ReaderPolicy::BLOCKING }
 Specifies the policy to use for reading from the stream. More...
 
enum  WriterPolicy { WriterPolicy::NONBLOCKABLE, WriterPolicy::ALL_OR_NOTHING, WriterPolicy::BLOCKING }
 Specifies the policy to use for writing to the stream. More...
 

Functions

template<typename FieldType , typename ClassType >
auto max_field_limit (FieldType(ClassType::*)) -> decltype(std::numeric_limits< FieldType >::max())
 

Typedef Documentation

◆ InProcessSDS

Type alias for a SharedDataStream which works between threads in a single process.

Enumeration Type Documentation

◆ ReaderPolicy

Specifies the policy to use for reading from the stream.

Enumerator
NONBLOCKING 

A NONBLOCKING Reader will return any available data (up to the amount requested) immediately, without waiting for more data to be written to the stream. If no data is available, a NONBLOCKING Reader will return Error::WOULDBLOCK.

BLOCKING 

A BLOCKING Reader will wait for up to the specified timeout (or forever if (timeout == 0)) for data to become available. As soon as at least one word is available, the Reader will return up to the requested amount of data. If no data becomes available in the specified timeout, a BLOCKING Reader will return Error::TIMEDOUT.

◆ WriterPolicy

Specifies the policy to use for writing to the stream.

Enumerator
NONBLOCKABLE 

A NONBLOCKABLE Writer will always write all the data provided without waiting for Readers to move out of the way.

Note
: This policy causes the Writer to notify BLOCKING Readers about new data being available without holding a mutex. This means that a read() call may miss a notification and block when data is actually available. The assumption here is that a NONBLOCKABLE Writer will be frequently writing data, and a subsequent write() will again notify the Reader and wake it up.
ALL_OR_NOTHING 

An ALL_OR_NOTHING Writer will either write all the data provided if it can do so without overwriting unconsumed data, or it will return Error::WOULDBLOCK without writing any data at all.

Note
: If there are no Readers attached, data can be written to a ShardDataStream until it fills up, but it will then stop accepting data from an ALL_OR_NOTHING Writer until a Reader attaches and consumes some of the data. However, there is a corner case where a Reader is attached, but has seek()ed into the future. In this scenario, all data written until the Writer catches up with the Reader will never be consumed, so the SharedDataStream will allow an ALL_OR_NOTHING Writer to continue writing new data (and discarding old data) until it reaches the index the Reader is waiting for.
BLOCKING 

A BLOCKING Writer will wait for up to the specified timeout (or forever if (timeout == 0)) for space to become available. As soon as at least one word can be written, the Writer will write as many words as it can without overwriting unconsumed data, and return the number of words written. If no space becomes available in the specified timeout, a BLOCKING Writer will return Error::TIMEDOUT.

Function Documentation

◆ max_field_limit()

template<typename FieldType , typename ClassType >
auto alexaClientSDK::avsCommon::utils::sds::max_field_limit ( FieldType(ClassType::*)  ) -> decltype(std::numeric_limits<FieldType>::max())
inline

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