AlexaClientSDK  1.25.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Public Types | Public Member Functions | Static Public Attributes | List of all members
alexaClientSDK::avsCommon::avs::attachment::InProcessAttachment Class Reference

#include <InProcessAttachment.h>

Inheritance diagram for alexaClientSDK::avsCommon::avs::attachment::InProcessAttachment:
Inheritance graph
[legend]
Collaboration diagram for alexaClientSDK::avsCommon::avs::attachment::InProcessAttachment:
Collaboration graph
[legend]

Public Types

using SDSType = avsCommon::utils::sds::InProcessSDS
 Type aliases for convenience. More...
 
using SDSBufferType = avsCommon::utils::sds::InProcessSDSTraits::Buffer
 

Public Member Functions

 InProcessAttachment (const std::string &id, std::unique_ptr< SDSType > sds=nullptr, size_t maxNumReaders=1)
 
std::unique_ptr< AttachmentWritercreateWriter (InProcessAttachmentWriter::SDSTypeWriter::Policy policy=InProcessAttachmentWriter::SDSTypeWriter::Policy::ALL_OR_NOTHING) override
 
std::unique_ptr< AttachmentReadercreateReader (InProcessAttachmentReader::SDSTypeReader::Policy policy) override
 
- Public Member Functions inherited from alexaClientSDK::avsCommon::avs::attachment::Attachment
 Attachment (const std::string &attachmentId)
 
virtual ~Attachment ()=default
 
virtual std::unique_ptr< AttachmentWritercreateWriter (utils::sds::WriterPolicy policy=utils::sds::WriterPolicy::ALL_OR_NOTHING)=0
 
virtual std::unique_ptr< AttachmentReadercreateReader (utils::sds::ReaderPolicy policy)=0
 
std::string getId () const
 
bool hasCreatedReader ()
 
bool hasCreatedWriter ()
 

Static Public Attributes

static const int SDS_BUFFER_DEFAULT_SIZE_IN_BYTES = 0x100000
 Default size of underlying SDS when created internally. More...
 

Additional Inherited Members

- Protected Attributes inherited from alexaClientSDK::avsCommon::avs::attachment::Attachment
const std::string m_id
 The id for this attachment object. More...
 
std::mutex m_mutex
 mutex to protext access to the createReader and createWriter API. More...
 
std::atomic< bool > m_hasCreatedWriter
 An atomic tracking variable to tell whether this object has created a writer. More...
 
std::atomic< size_t > m_numReaders
 An atomic tracking variable to tell how many readers have been created. More...
 

Detailed Description

A class that represents an AVS attachment following an in-process memory management model.

Member Typedef Documentation

◆ SDSBufferType

◆ SDSType

Type aliases for convenience.

Constructor & Destructor Documentation

◆ InProcessAttachment()

alexaClientSDK::avsCommon::avs::attachment::InProcessAttachment::InProcessAttachment ( const std::string &  id,
std::unique_ptr< SDSType sds = nullptr,
size_t  maxNumReaders = 1 
)

Constructor.

Parameters
idThe attachment id.
sdsThe underlying SharedDataStream object. If not specified, then this class will create its own.
maxNumReadersThe maximum number of readers allowed.

Member Function Documentation

◆ createReader()

std::unique_ptr< AttachmentReader > alexaClientSDK::avsCommon::avs::attachment::InProcessAttachment::createReader ( InProcessAttachmentReader::SDSTypeReader::Policy  policy)
override

◆ createWriter()

std::unique_ptr< AttachmentWriter > alexaClientSDK::avsCommon::avs::attachment::InProcessAttachment::createWriter ( InProcessAttachmentWriter::SDSTypeWriter::Policy  policy = InProcessAttachmentWriter::SDSTypeWriter::Policy::ALL_OR_NOTHING)
override

Member Data Documentation

◆ SDS_BUFFER_DEFAULT_SIZE_IN_BYTES

const int alexaClientSDK::avsCommon::avs::attachment::InProcessAttachment::SDS_BUFFER_DEFAULT_SIZE_IN_BYTES = 0x100000
static

Default size of underlying SDS when created internally.


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

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