![]() |
AlexaClientSDK
3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
|
#include <AttachmentWriter.h>
Public Types | |
enum | WriteStatus { WriteStatus::OK, WriteStatus::CLOSED, WriteStatus::OK_BUFFER_FULL, WriteStatus::ERROR_BYTES_LESS_THAN_WORD_SIZE, WriteStatus::ERROR_INTERNAL, WriteStatus::TIMEDOUT } |
Public Member Functions | |
virtual | ~AttachmentWriter ()=default |
virtual std::size_t | write (const void *buf, std::size_t numBytes, WriteStatus *writeStatus, std::chrono::milliseconds timeout=std::chrono::milliseconds(0))=0 |
virtual void | close ()=0 |
A class that provides functionality to write data to an Attachment
.
An enum class to communicate the possible states following a write()
call.
|
virtualdefault |
Destructor.
|
pure virtual |
The close function. An implementation will take care of any resource management when a writer no longer needs to use an attachment.
Implemented in alexaClientSDK::avsCommon::avs::attachment::InProcessAttachmentWriter, and alexaClientSDK::avsCommon::utils::TestableAttachmentWriter.
|
pure virtual |
The write function.
buf | The buffer where data should be copied from. | |
numBytes | The size of the buffer in bytes. | |
[out] | writeStatus | The out-parameter where the resulting state of the write will be expressed. |
timeout | The maximum time to wait (if policy is BLOCKING ) for space to write into. If this parameter is zero, there is no timeout and blocking writes will wait forever. If policy is not BLOCKING, this parameter is ignored. |
Implemented in alexaClientSDK::avsCommon::avs::attachment::InProcessAttachmentWriter, and alexaClientSDK::avsCommon::utils::TestableAttachmentWriter.
AlexaClientSDK 3.0.0 - Copyright 2016-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0