AWS SDK for C++

AWS SDK for C++ Version 1.11.875

Loading...
Searching...
No Matches
ProgressSnapshot.h
1
5#pragma once
6#include <aws/s3-transfer/S3Transfer_EXPORTS.h>
7#include <aws/s3-transfer/DownloadResponse.h>
8#include <aws/s3-transfer/UploadResponse.h>
9#include <cstdint>
10#include <memory>
11#include <utility>
12
13namespace Aws {
14namespace S3 {
15namespace Transfer {
16
22template <typename ResponseT>
24 public:
25 virtual ~ProgressSnapshot() = default;
26
27 ProgressSnapshot(uint64_t transferredBytes,
28 uint64_t totalBytes,
29 std::shared_ptr<ResponseT> response,
30 bool totalBytesHasBeenSet)
31 : m_transferredBytes(transferredBytes),
32 m_totalBytes(totalBytes),
33 m_response(std::move(response)),
34 m_totalBytesHasBeenSet(totalBytesHasBeenSet) {}
35
36 inline uint64_t GetTransferredBytes() const { return m_transferredBytes; }
37 inline uint64_t GetTotalBytes() const { return m_totalBytes; }
38 inline bool TotalBytesHasBeenSet() const { return m_totalBytesHasBeenSet; }
39 inline const std::shared_ptr<ResponseT>& GetResponse() const { return m_response; }
40 inline bool ResponseHasBeenSet() const { return m_response != nullptr; }
41
42 private:
43 uint64_t m_transferredBytes = 0;
44 uint64_t m_totalBytes = 0;
45 std::shared_ptr<ResponseT> m_response;
46 bool m_totalBytesHasBeenSet = false;
47};
48
53class AWS_S3_TRANSFER_API UploadProgressSnapshot final : public ProgressSnapshot<UploadResponse> {
54 public:
55 using ProgressSnapshot<UploadResponse>::ProgressSnapshot;
56};
57
63class AWS_S3_TRANSFER_API DownloadProgressSnapshot final : public ProgressSnapshot<DownloadResponse> {
64 public:
65 using ProgressSnapshot<DownloadResponse>::ProgressSnapshot;
66};
67
68} // namespace Transfer
69} // namespace S3
70} // namespace Aws
ProgressSnapshot(uint64_t transferredBytes, uint64_t totalBytes, std::shared_ptr< ResponseT > response, bool totalBytesHasBeenSet)
const std::shared_ptr< ResponseT > & GetResponse() const