◆ MockAttachmentReader()
alexaClientSDK::mediaPlayer::test::MockAttachmentReader::MockAttachmentReader |
( |
int |
iterations = 1 , |
|
|
std::vector< size_t > |
receiveSizes = {std::numeric_limits<size_t>::max()} |
|
) |
| |
Constructor.
- Parameters
-
iterations | The number of times this AttachmentReader will (re)read the input file before read will return a CLOSED status. |
receiveSizes | An vector of sizes (in bytes) that this AttachmentReceiver will simulate receiving. Each successive element in the vector corresponds to a successive 100 millisecond interval starting from the time this MockAttachmentReader was created. |
◆ close()
void alexaClientSDK::mediaPlayer::test::MockAttachmentReader::close |
( |
ClosePoint |
closePoint | ) |
|
|
overridevirtual |
◆ getNumUnreadBytes()
uint64_t alexaClientSDK::mediaPlayer::test::MockAttachmentReader::getNumUnreadBytes |
( |
| ) |
|
|
inlineoverridevirtual |
◆ read()
size_t alexaClientSDK::mediaPlayer::test::MockAttachmentReader::read |
( |
void * |
buf, |
|
|
std::size_t |
numBytes, |
|
|
ReadStatus * |
readStatus, |
|
|
std::chrono::milliseconds |
timeoutMs |
|
) |
| |
|
overridevirtual |
The read function.
- Parameters
-
| buf | The buffer where data should be copied to. |
| numBytes | The size of the buffer in bytes. |
[out] | readStatus | The out-parameter where the resulting state of the read will be expressed. |
| timeoutMs | The timeout for this read call in milliseconds. This value is only used for the BLOCKING reader policy. If this parameter is zero, there is no timeout and blocking reads will wait forever. |
- Returns
- The number of bytes read as a result of this call.
Implements alexaClientSDK::avsCommon::avs::attachment::AttachmentReader.
◆ receiveBytes()
size_t alexaClientSDK::mediaPlayer::test::MockAttachmentReader::receiveBytes |
( |
char * |
buf, |
|
|
std::size_t |
size |
|
) |
| |
Receive bytes from the test file.
- Parameters
-
buf | The buffer to receive the bytes. |
size | The number of bytes to receive. |
- Returns
- The number of bytes received.
◆ seek()
bool alexaClientSDK::mediaPlayer::test::MockAttachmentReader::seek |
( |
uint64_t |
offset | ) |
|
|
inlineoverridevirtual |
The seek function.
- Parameters
-
offset | The offset to seek to within the Attachment . |
- Returns
true
if the specified position points at unexpired data, or false
otherwise. Note that it is valid to seek into a future index that has not been written to yet.
Implements alexaClientSDK::avsCommon::avs::attachment::AttachmentReader.
◆ m_iterationsLeft
int alexaClientSDK::mediaPlayer::test::MockAttachmentReader::m_iterationsLeft |
The number of iterations of reading the input file that are left before this reader returns closed.
◆ m_receiveTotals
std::vector<size_t> alexaClientSDK::mediaPlayer::test::MockAttachmentReader::m_receiveTotals |
The total number of bytes that are supposed to have been received (and made available) by this AttachmentReader
at 100 millisecond increments from m_startTime
.
◆ m_startTime
std::chrono::steady_clock::time_point alexaClientSDK::mediaPlayer::test::MockAttachmentReader::m_startTime |
The start of time for reading from this AttachmentReader.
◆ m_stream
std::unique_ptr<std::ifstream> alexaClientSDK::mediaPlayer::test::MockAttachmentReader::m_stream |
The current ifstream (if any) from which to read the attachment.
◆ m_totalRead
size_t alexaClientSDK::mediaPlayer::test::MockAttachmentReader::m_totalRead |
The number of bytes returned so far by read()
.
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