AlexaClientSDK  1.25.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Public Member Functions | Public Attributes | List of all members
alexaClientSDK::avsCommon::utils::http2::MockHTTP2MimeRequestEncodeSource Class Reference

#include <MockHTTP2MimeRequestEncodeSource.h>

Inheritance diagram for alexaClientSDK::avsCommon::utils::http2::MockHTTP2MimeRequestEncodeSource:
Inheritance graph
[legend]
Collaboration diagram for alexaClientSDK::avsCommon::utils::http2::MockHTTP2MimeRequestEncodeSource:
Collaboration graph
[legend]

Public Member Functions

 MockHTTP2MimeRequestEncodeSource (const std::vector< std::string > &m_data, const std::vector< std::vector< std::string >> &m_headers)
 
 ~MockHTTP2MimeRequestEncodeSource ()=default
 
HTTP2MimeRequestSourceInterface methods.
HTTP2GetMimeHeadersResult getMimePartHeaderLines () override
 
HTTP2SendDataResult onSendMimePartData (char *bytes, size_t size) override
 
std::vector< std::string > getRequestHeaderLines () override
 
- Public Member Functions inherited from alexaClientSDK::avsCommon::utils::http2::HTTP2MimeRequestSourceInterface
virtual ~HTTP2MimeRequestSourceInterface ()=default
 

Public Attributes

std::vector< std::string > m_data
 Stores the MIME data parts. More...
 
std::vector< std::vector< std::string > > m_headers
 Stores the MIME header parts. More...
 
size_t m_bytesWritten
 Index into the current MIME data part. More...
 
size_t m_index
 Index of current MIME part being read. More...
 
bool m_slowSource
 Enable sending PAUSE intermittently. More...
 
bool m_abort
 If ABORT is to be sent. More...
 
size_t m_pauseCount
 PAUSE count. More...
 

Detailed Description

Mock class which implements the HTTP2MIMERequestSourceInterface to allow testing

Constructor & Destructor Documentation

◆ MockHTTP2MimeRequestEncodeSource()

alexaClientSDK::avsCommon::utils::http2::MockHTTP2MimeRequestEncodeSource::MockHTTP2MimeRequestEncodeSource ( const std::vector< std::string > &  m_data,
const std::vector< std::vector< std::string >> &  m_headers 
)

Constructor which accepts the various MIME parts to be passed onto the encoder as the request source

Parameters
m_datavector of MIME data parts
m_headersvector of MIME headers

◆ ~MockHTTP2MimeRequestEncodeSource()

alexaClientSDK::avsCommon::utils::http2::MockHTTP2MimeRequestEncodeSource::~MockHTTP2MimeRequestEncodeSource ( )
default

Destructor

Member Function Documentation

◆ getMimePartHeaderLines()

HTTP2GetMimeHeadersResult alexaClientSDK::avsCommon::utils::http2::MockHTTP2MimeRequestEncodeSource::getMimePartHeaderLines ( )
overridevirtual

Get the header lines that should be output with the next mime part. This will be called once before onSendMimePartData() is called for the first mime part and after each call to onSendMimePartData() that returns HTTP2SendDataResult.status == COMPLETE.

Note
Calls to this method may block network operations for the associated instance of HTTP2ConnectionInterface, so they should return quickly.
Returns
An HTTP2GetMimeHeadersResult specifying the status of the operation and a vector of header lines if the status was CONTINUE.

Implements alexaClientSDK::avsCommon::utils::http2::HTTP2MimeRequestSourceInterface.

◆ getRequestHeaderLines()

std::vector< std::string > alexaClientSDK::avsCommon::utils::http2::MockHTTP2MimeRequestEncodeSource::getRequestHeaderLines ( )
overridevirtual

Get the header lines that should be output with this HTTP2 request.

Note
Calls to this method may block network operations for the associated instance of HTTP2ConnectionInterface, so they should return quickly.
Returns
The header lines that should be output with this request.

Implements alexaClientSDK::avsCommon::utils::http2::HTTP2MimeRequestSourceInterface.

◆ onSendMimePartData()

HTTP2SendDataResult alexaClientSDK::avsCommon::utils::http2::MockHTTP2MimeRequestEncodeSource::onSendMimePartData ( char *  bytes,
size_t  size 
)
overridevirtual

Notification to copy data to be mime encoded in to an HTTP2 request.

Note
Calls to this method may block network operations for the associated instance of HTTP2ConnectionInterface, so they should return quickly.
Parameters
bytesThe buffer to receive the bytes to send.
sizeThe max number of bytes to copy.
Returns
Result indicating the disposition of the operation and number of bytes copied.
See also
HTTPSendMimePartDataResult.

Implements alexaClientSDK::avsCommon::utils::http2::HTTP2MimeRequestSourceInterface.

Member Data Documentation

◆ m_abort

bool alexaClientSDK::avsCommon::utils::http2::MockHTTP2MimeRequestEncodeSource::m_abort

If ABORT is to be sent.

◆ m_bytesWritten

size_t alexaClientSDK::avsCommon::utils::http2::MockHTTP2MimeRequestEncodeSource::m_bytesWritten

Index into the current MIME data part.

◆ m_data

std::vector<std::string> alexaClientSDK::avsCommon::utils::http2::MockHTTP2MimeRequestEncodeSource::m_data

Stores the MIME data parts.

These will be kept public to help testing

◆ m_headers

std::vector<std::vector<std::string> > alexaClientSDK::avsCommon::utils::http2::MockHTTP2MimeRequestEncodeSource::m_headers

Stores the MIME header parts.

◆ m_index

size_t alexaClientSDK::avsCommon::utils::http2::MockHTTP2MimeRequestEncodeSource::m_index

Index of current MIME part being read.

◆ m_pauseCount

size_t alexaClientSDK::avsCommon::utils::http2::MockHTTP2MimeRequestEncodeSource::m_pauseCount

PAUSE count.

◆ m_slowSource

bool alexaClientSDK::avsCommon::utils::http2::MockHTTP2MimeRequestEncodeSource::m_slowSource

Enable sending PAUSE intermittently.


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