AWS SDK for C++

AWS SDK for C++ Version 1.11.875

Loading...
Searching...
No Matches
S3DownloadBuffer.h
1
5#pragma once
6#include <aws/s3-transfer/S3Transfer_EXPORTS.h>
7#include <aws/crt/s3/S3.h>
8#include <cstdint>
9#include <memory>
10
11namespace Aws {
12namespace S3 {
13namespace Transfer {
14
20class AWS_S3_TRANSFER_API S3DownloadBuffer final {
21 public:
22 // The cursor carries the per-part body delivered by the CRT; the ticket is an owning reference
23 // that keeps the underlying CRT-owned buffer alive for as long as this object (or a copy) is alive.
24 explicit S3DownloadBuffer(std::shared_ptr<Aws::Crt::S3::S3BufferTicket> ticket,
25 Aws::Crt::ByteCursor bytes, uint64_t rangeStart) noexcept;
26
31 ~S3DownloadBuffer() = default;
32
33 // Cursor into CRT-owned memory; empty if the part carried no bytes.
34 inline Aws::Crt::ByteCursor GetData() const { return m_bytes; }
35 // Byte offset within the object at which this part begins.
36 inline uint64_t GetRangeStart() const { return m_rangeStart; }
37
38 private:
39 std::shared_ptr<Aws::Crt::S3::S3BufferTicket> m_ticket;
40 Aws::Crt::ByteCursor m_bytes;
41 uint64_t m_rangeStart;
42};
43
44} // namespace Transfer
45} // namespace S3
46} // namespace Aws
S3DownloadBuffer(S3DownloadBuffer &&other) noexcept
S3DownloadBuffer(const S3DownloadBuffer &)=delete
S3DownloadBuffer & operator=(const S3DownloadBuffer &)=delete
S3DownloadBuffer(std::shared_ptr< Aws::Crt::S3::S3BufferTicket > ticket, Aws::Crt::ByteCursor bytes, uint64_t rangeStart) noexcept
S3DownloadBuffer & operator=(S3DownloadBuffer &&other) noexcept
Aws::Crt::ByteCursor GetData() const