AlexaClientSDK
3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
|
#include <BufferLayout.h>
Public Attributes | |
uint32_t | magic |
uint8_t | version |
uint32_t | traitsNameHash |
uint16_t | wordSize |
uint8_t | maxReaders |
uint8_t | maxEphemeralReaders |
ConditionVariable | dataAvailableConditionVariable |
This field contains the condition variable used to notify Readers that data is available. More... | |
Mutex | dataAvailableMutex |
This field contains the mutex used by dataAvailableConditionVariable . More... | |
ConditionVariable | spaceAvailableConditionVariable |
Mutex | backwardSeekMutex |
AtomicBool | isWriterEnabled |
This field indicates whether there is an enabled (not closed) Writer . More... | |
AtomicBool | hasWriterBeenClosed |
This field indicates that a Writer had at one point been enabled and then closed. More... | |
Mutex | writerEnableMutex |
AtomicIndex | writeStartCursor |
This field contains the next location to write to. More... | |
AtomicIndex | writeEndCursor |
AtomicIndex | oldestUnconsumedCursor |
uint32_t | referenceCount |
This field tracks the number of BufferLayout instances currently attached to a Buffer. More... | |
Mutex | attachMutex |
Mutex | readerEnableMutex |
This structure defines the header fields for the Buffer
. The header fields in the shared Buffer
are the mechanism by which SDS instances in different processes share state. When initializing a new Buffer
, this struct must be placement-constructed at the base of the Buffer
. When accessing a pre-initialized Buffer
, this struct must be reinterpret_cast from the base of the Buffer
.
Mutex alexaClientSDK::avsCommon::utils::sds::SharedDataStream::BufferLayout< T >::Header::attachMutex |
This mutex protects attaching/detatching BufferLayout instances to a Buffer. Specifically, it must be held when updating referenceCount, and while cleaning up after referenceCount reaches zero.
Mutex alexaClientSDK::avsCommon::utils::sds::SharedDataStream::BufferLayout< T >::Header::backwardSeekMutex |
This field contains a mutex used to temporarily hold off Readers
from seeking backwards in the buffer while a Reader
is updating oldestUnconsumedCursor
. The is necessary to prevent a race condition where a Reader::seek()
at the same time that a Reader
is updating oldestUnconsumedCursor
could result in a Reader
which is reading from an older Index
than oldestUnconsumedCursor
.
ConditionVariable alexaClientSDK::avsCommon::utils::sds::SharedDataStream::BufferLayout< T >::Header::dataAvailableConditionVariable |
This field contains the condition variable used to notify Readers
that data is available.
Mutex alexaClientSDK::avsCommon::utils::sds::SharedDataStream::BufferLayout< T >::Header::dataAvailableMutex |
This field contains the mutex used by dataAvailableConditionVariable
.
AtomicBool alexaClientSDK::avsCommon::utils::sds::SharedDataStream::BufferLayout< T >::Header::hasWriterBeenClosed |
This field indicates that a Writer
had at one point been enabled and then closed.
AtomicBool alexaClientSDK::avsCommon::utils::sds::SharedDataStream::BufferLayout< T >::Header::isWriterEnabled |
This field indicates whether there is an enabled (not closed) Writer
.
uint32_t alexaClientSDK::avsCommon::utils::sds::SharedDataStream::BufferLayout< T >::Header::magic |
This field contains the magic number which is used to identify a valid Header
. For a SharedDataStream::buffer
to be valid, this field must contain MAGIC_NUMBER
.
uint8_t alexaClientSDK::avsCommon::utils::sds::SharedDataStream::BufferLayout< T >::Header::maxEphemeralReaders |
This field specifies the maximum number of ephemeral Readers
created without specifying an id
.
uint8_t alexaClientSDK::avsCommon::utils::sds::SharedDataStream::BufferLayout< T >::Header::maxReaders |
This field specifies the maximum number of Readers
.
Header
in the Buffer
. AtomicIndex alexaClientSDK::avsCommon::utils::sds::SharedDataStream::BufferLayout< T >::Header::oldestUnconsumedCursor |
This field contains the location of oldest word in the buffer which has not been consumed (read by a Reader
). This field is used as a barrier by Writers
which have a policy not to overwrite readers.
Mutex alexaClientSDK::avsCommon::utils::sds::SharedDataStream::BufferLayout< T >::Header::readerEnableMutex |
This mutex is used to protect creation of readers. In particular, it is locked when attempting to add a new reader so that there are no races between overlapping calls to createReader()
.
uint32_t alexaClientSDK::avsCommon::utils::sds::SharedDataStream::BufferLayout< T >::Header::referenceCount |
This field tracks the number of BufferLayout instances currently attached to a Buffer.
ConditionVariable alexaClientSDK::avsCommon::utils::sds::SharedDataStream::BufferLayout< T >::Header::spaceAvailableConditionVariable |
This field contains the condition variable used to notify Writers
that space is available. Note that this condition variable does not have a dedicated mutex; the condition is protected by backwardSeekMutex.
uint32_t alexaClientSDK::avsCommon::utils::sds::SharedDataStream::BufferLayout< T >::Header::traitsNameHash |
This field contains a stable hash of the T::traitsName
string from the SharedDataStream::create()
call. For a SharedDataStream
to open()
a buffer, this field must match the caller's T::traitsName
string hash.
uint8_t alexaClientSDK::avsCommon::utils::sds::SharedDataStream::BufferLayout< T >::Header::version |
This field specifies the version of the header layout used for the subsequent fields. For a SharedDataStream
to use a buffer, this field must match VERSION
.
uint16_t alexaClientSDK::avsCommon::utils::sds::SharedDataStream::BufferLayout< T >::Header::wordSize |
This field specifies the word size (in bytes). All SharedDataStream operations that work with data or position in the stream are quantified in words.
AtomicIndex alexaClientSDK::avsCommon::utils::sds::SharedDataStream::BufferLayout< T >::Header::writeEndCursor |
This field contains the end of the region currently being written to (when no write is in progress, (writEndCursor == writeStartCursor)
).
Mutex alexaClientSDK::avsCommon::utils::sds::SharedDataStream::BufferLayout< T >::Header::writerEnableMutex |
This mutex is used to protect creation of the writer. In particular, it is locked when attempting to add the writer so that there are no races between overlapping calls to createWriter()
.
AtomicIndex alexaClientSDK::avsCommon::utils::sds::SharedDataStream::BufferLayout< T >::Header::writeStartCursor |
This field contains the next location to write to.
AlexaClientSDK 3.0.0 - Copyright 2016-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0