AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Public Member Functions | Protected Attributes | List of all members
alexaClientSDK::avsCommon::avs::attachment::Attachment Class Referenceabstract

#include <Attachment.h>

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

Public Member Functions

 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 ()
 

Protected Attributes

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.

Constructor & Destructor Documentation

◆ Attachment()

alexaClientSDK::avsCommon::avs::attachment::Attachment::Attachment ( const std::string &  attachmentId)

Constructor.

Parameters
attachmentIdThe id for this attachment.

◆ ~Attachment()

virtual alexaClientSDK::avsCommon::avs::attachment::Attachment::~Attachment ( )
virtualdefault

Destructor.

Member Function Documentation

◆ createReader()

virtual std::unique_ptr<AttachmentReader> alexaClientSDK::avsCommon::avs::attachment::Attachment::createReader ( utils::sds::ReaderPolicy  policy)
pure virtual

Creates a reader object, with which the Attachment may be read from.

Parameters
Thepolicy used to configure the reader.
Returns
a to an AttachmentReader.

◆ createWriter()

virtual std::unique_ptr<AttachmentWriter> alexaClientSDK::avsCommon::avs::attachment::Attachment::createWriter ( utils::sds::WriterPolicy  policy = utils::sds::WriterPolicy::ALL_OR_NOTHING)
pure virtual

Creates a writer object, with which the Attachment may be written to.

Returns
a to an AttachmentWriter.

◆ getId()

std::string alexaClientSDK::avsCommon::avs::attachment::Attachment::getId ( ) const

An accessor to get the attachmentId.

Returns
The attachment Id.

◆ hasCreatedReader()

bool alexaClientSDK::avsCommon::avs::attachment::Attachment::hasCreatedReader ( )

Utility function to tell if a reader has been created for this object.

Returns
Whether a reader has been created for this object.

◆ hasCreatedWriter()

bool alexaClientSDK::avsCommon::avs::attachment::Attachment::hasCreatedWriter ( )

Utility function to tell if a writer has been created for this object.

Returns
Whether a writer has been created for this object.

Member Data Documentation

◆ m_hasCreatedWriter

std::atomic<bool> alexaClientSDK::avsCommon::avs::attachment::Attachment::m_hasCreatedWriter
protected

An atomic tracking variable to tell whether this object has created a writer.

◆ m_id

const std::string alexaClientSDK::avsCommon::avs::attachment::Attachment::m_id
protected

The id for this attachment object.

◆ m_mutex

std::mutex alexaClientSDK::avsCommon::avs::attachment::Attachment::m_mutex
protected

mutex to protext access to the createReader and createWriter API.

◆ m_numReaders

std::atomic<size_t> alexaClientSDK::avsCommon::avs::attachment::Attachment::m_numReaders
protected

An atomic tracking variable to tell how many readers have been created.


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

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