Skip to content

Commit 976f5fc

Browse files
committed
Updates to TM headers
1 parent cbe24dc commit 976f5fc

15 files changed

Lines changed: 67 additions & 152 deletions

src/aws-cpp-sdk-s3-transfer/include/aws/s3-transfer/DownloadHandle.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,16 @@ class DownloadHandleImpl;
1919
* Returned from S3TransferManager::Download to represent a single in-flight download. The
2020
* handle is freely copyable; all copies share the same underlying transfer state.
2121
*/
22-
class AWS_S3_TRANSFER_API DownloadHandle {
22+
class AWS_S3_TRANSFER_API DownloadHandle final {
2323
public:
2424
~DownloadHandle();
25+
DownloadHandle(DownloadHandle&&) noexcept;
26+
DownloadHandle& operator=(DownloadHandle&&) noexcept;
2527

2628
/**
2729
* Returns a future that resolves once the transfer finishes, succeeds, or fails.
2830
*/
29-
std::shared_future<DownloadOutcome> CompletionFuture() const;
31+
std::future<DownloadOutcome> CompletionFuture();
3032

3133
/**
3234
* Requests cancellation of the in-flight download. Returns immediately; the future
@@ -35,7 +37,7 @@ class AWS_S3_TRANSFER_API DownloadHandle {
3537
void Cancel();
3638

3739
private:
38-
std::shared_ptr<DownloadHandleImpl> m_impl;
40+
std::unique_ptr<DownloadHandleImpl> m_impl;
3941
};
4042

4143

src/aws-cpp-sdk-s3-transfer/include/aws/s3-transfer/DownloadProgressListener.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,23 +24,23 @@ class AWS_S3_TRANSFER_API DownloadProgressListener {
2424
/**
2525
* Invoked exactly once when the download begins, before any bytes have been transferred.
2626
*/
27-
virtual void OnTransferInitiated(const DownloadRequest&, const DownloadProgressSnapshot&) {}
27+
virtual void OnTransferInitiated(const DownloadRequest& /*request*/, const DownloadProgressSnapshot& /*snapshot*/) {}
2828

2929
/**
3030
* Invoked as bytes are received from S3. Called at least once for a successful transfer
3131
* and may be called many times depending on object size and I/O buffer sizes.
3232
*/
33-
virtual void OnBytesTransferred(const DownloadRequest&, const DownloadProgressSnapshot&) {}
33+
virtual void OnBytesTransferred(const DownloadRequest& /*request*/, const DownloadProgressSnapshot& /*snapshot*/) {}
3434

3535
/**
3636
* Invoked exactly once when the download completes successfully.
3737
*/
38-
virtual void OnTransferComplete(const DownloadRequest&, const DownloadProgressSnapshot&) {}
38+
virtual void OnTransferComplete(const DownloadRequest& /*request*/, const DownloadProgressSnapshot& /*snapshot*/) {}
3939

4040
/**
4141
* Invoked exactly once when the download fails or is cancelled.
4242
*/
43-
virtual void OnTransferFailed(const DownloadRequest&, const DownloadProgressSnapshot&) {}
43+
virtual void OnTransferFailed(const DownloadRequest& /*request*/, const DownloadProgressSnapshot& /*snapshot*/) {}
4444
};
4545

4646
}

src/aws-cpp-sdk-s3-transfer/include/aws/s3-transfer/DownloadProgressSnapshot.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ namespace Transfer {
1818
* Captures bytes transferred, total bytes (known after the GetObject response is received),
1919
* and the response once available.
2020
*/
21-
class AWS_S3_TRANSFER_API DownloadProgressSnapshot {
21+
22+
class AWS_S3_TRANSFER_API DownloadProgressSnapshot final {
2223
public:
2324
DownloadProgressSnapshot(uint64_t transferredBytes,
2425
uint64_t totalBytes,

src/aws-cpp-sdk-s3-transfer/include/aws/s3-transfer/DownloadRequest.h

Lines changed: 14 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -21,72 +21,31 @@ namespace Transfer {
2121
* with the local destination (file path or stream factory) and any request-level progress
2222
* listeners. The transfer manager parallelizes large objects via ranged GETs internally.
2323
*/
24-
class AWS_S3_TRANSFER_API DownloadRequest {
24+
class AWS_S3_TRANSFER_API DownloadRequest final {
2525
public:
26-
inline const Aws::S3::Model::GetObjectRequest& GetS3Request() const { return m_s3Request; }
27-
inline bool S3RequestHasBeenSet() const { return m_s3RequestHasBeenSet; }
28-
template <typename S3RequestT = Aws::S3::Model::GetObjectRequest>
29-
void SetS3Request(S3RequestT&& val) {
30-
m_s3RequestHasBeenSet = true;
31-
m_s3Request = std::forward<S3RequestT>(val);
32-
}
33-
template <typename S3RequestT = Aws::S3::Model::GetObjectRequest>
34-
DownloadRequest& WithS3Request(S3RequestT&& value) {
35-
SetS3Request(std::forward<S3RequestT>(value));
36-
return *this;
37-
}
26+
explicit DownloadRequest(
27+
Aws::S3::Model::GetObjectRequest s3Request,
28+
Aws::String destinationFilePath,
29+
Aws::IOStreamFactory responseStreamFactory,
30+
Aws::Vector<std::shared_ptr<DownloadProgressListener>> transferListeners = {})
31+
: m_s3Request(std::move(s3Request)),
32+
m_destinationFilePath(std::move(destinationFilePath)),
33+
m_responseStreamFactory(std::move(responseStreamFactory)),
34+
m_transferListeners(std::move(transferListeners)) {}
3835

36+
inline const Aws::S3::Model::GetObjectRequest& GetS3Request() const { return m_s3Request; }
3937
inline const Aws::String& GetDestinationFilePath() const { return m_destinationFilePath; }
40-
inline bool DestinationFilePathHasBeenSet() const { return m_destinationFilePathHasBeenSet; }
41-
template <typename DestinationFilePathT = Aws::String>
42-
void SetDestinationFilePath(DestinationFilePathT&& value) {
43-
m_destinationFilePathHasBeenSet = true;
44-
m_destinationFilePath = std::forward<DestinationFilePathT>(value);
45-
}
46-
template <typename DestinationFilePathT = Aws::String>
47-
DownloadRequest& WithDestinationFilePath(DestinationFilePathT&& value) {
48-
SetDestinationFilePath(std::forward<DestinationFilePathT>(value));
49-
return *this;
50-
}
51-
52-
inline const Aws::IOStreamFactory& GetBody() const { return m_body; }
53-
inline bool BodyHasBeenSet() const { return m_bodyHasBeenSet; }
54-
inline void SetBody(const Aws::IOStreamFactory& val) {
55-
m_bodyHasBeenSet = true;
56-
m_body = val;
57-
}
58-
inline DownloadRequest& WithBody(const Aws::IOStreamFactory& val) {
59-
SetBody(val);
60-
return *this;
61-
}
62-
38+
inline const Aws::IOStreamFactory& GetResponseStreamFactory() const { return m_responseStreamFactory; }
6339
inline const Aws::Vector<std::shared_ptr<DownloadProgressListener>>& GetTransferListeners() const {
6440
return m_transferListeners;
6541
}
66-
inline bool TransferListenersHasBeenSet() const { return m_transferListenersHasBeenSet; }
67-
inline void SetTransferListeners(const Aws::Vector<std::shared_ptr<DownloadProgressListener>>& val) {
68-
m_transferListenersHasBeenSet = true;
69-
m_transferListeners = val;
70-
}
71-
inline DownloadRequest& WithTransferListeners(const Aws::Vector<std::shared_ptr<DownloadProgressListener>>& val) {
72-
SetTransferListeners(val);
73-
return *this;
74-
}
75-
inline DownloadRequest& AddTransferListener(const std::shared_ptr<DownloadProgressListener>& listener) {
76-
m_transferListenersHasBeenSet = true;
77-
m_transferListeners.push_back(listener);
78-
return *this;
79-
}
42+
8043

8144
private:
8245
Aws::S3::Model::GetObjectRequest m_s3Request;
8346
Aws::String m_destinationFilePath;
84-
Aws::IOStreamFactory m_body;
47+
Aws::IOStreamFactory m_responseStreamFactory;
8548
Aws::Vector<std::shared_ptr<DownloadProgressListener>> m_transferListeners;
86-
bool m_s3RequestHasBeenSet = false;
87-
bool m_destinationFilePathHasBeenSet = false;
88-
bool m_bodyHasBeenSet = false;
89-
bool m_transferListenersHasBeenSet = false;
9049
};
9150

9251
}

src/aws-cpp-sdk-s3-transfer/include/aws/s3-transfer/DownloadResponse.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ namespace Transfer {
1919
* the underlying S3 GetObjectResult with whole-object content length and range, regardless
2020
* of how many ranged GETs were issued internally.
2121
*/
22-
class AWS_S3_TRANSFER_API DownloadResponse {
22+
class AWS_S3_TRANSFER_API DownloadResponse final {
2323
public:
2424
inline const Aws::S3::Model::GetObjectResult& GetS3Result() const { return m_s3Result; }
2525
inline bool S3ResultHasBeenSet() const { return m_s3ResultHasBeenSet; }

src/aws-cpp-sdk-s3-transfer/include/aws/s3-transfer/S3TransferManager.h

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,17 @@ namespace Aws {
1616
class S3TransferManagerImpl;
1717

1818
/**
19-
* High-level S3 transfer client backed by the AWS Common Runtime. Performs single-file
20-
* uploads and downloads, automatically using multipart transfers for objects larger than
21-
* the configured threshold. Customers hold an instance via shared_ptr; the manager owns
22-
* the underlying CRT client and is not copyable or movable.
19+
* Customers construct an instance directly. The manager owns the underlying CRT
20+
* client; it is movable but not copyable.
2321
*/
24-
class AWS_S3_TRANSFER_API S3TransferManager: public std::enable_shared_from_this<S3TransferManager> {
22+
class AWS_S3_TRANSFER_API S3TransferManager final {
2523
public:
26-
static std::shared_ptr<S3TransferManager> Create(const S3TransferManagerConfiguration& config);
27-
24+
explicit S3TransferManager(const S3TransferManagerConfiguration& config);
2825
~S3TransferManager();
2926

3027
S3TransferManager(const S3TransferManager&) = delete;
3128
S3TransferManager& operator=(const S3TransferManager&) = delete;
32-
S3TransferManager(S3TransferManager&&) = delete;
33-
S3TransferManager& operator=(S3TransferManager&&) = delete;
29+
3430

3531
/**
3632
* Begin uploading the object described by request. Returns immediately with a handle
@@ -45,7 +41,6 @@ namespace Aws {
4541
DownloadHandle Download(const DownloadRequest& request);
4642

4743
private:
48-
explicit S3TransferManager(const S3TransferManagerConfiguration& config);
4944
Aws::UniquePtr<S3TransferManagerImpl> m_impl;
5045
};
5146
}

src/aws-cpp-sdk-s3-transfer/include/aws/s3-transfer/UploadHandle.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,16 @@ class UploadHandleImpl;
1919
* Returned from S3TransferManager::Upload to represent a single in-flight upload. The
2020
* handle is freely copyable; all copies share the same underlying transfer state.
2121
*/
22-
class AWS_S3_TRANSFER_API UploadHandle {
22+
class AWS_S3_TRANSFER_API UploadHandle final {
2323
public:
2424
~UploadHandle();
25+
UploadHandle(UploadHandle&&) noexcept;
26+
UploadHandle& operator=(UploadHandle&&) noexcept;
2527

2628
/**
2729
* Returns a future that resolves once the transfer finishes, succeeds, or fails.
2830
*/
29-
std::shared_future<UploadOutcome> CompletionFuture() const;
31+
std::future<UploadOutcome> CompletionFuture();
3032

3133
/**
3234
* Requests cancellation of the in-flight upload. Returns immediately; the future
@@ -35,7 +37,7 @@ class AWS_S3_TRANSFER_API UploadHandle {
3537
void Cancel();
3638

3739
private:
38-
std::shared_ptr<UploadHandleImpl> m_impl;
40+
std::unique_ptr<UploadHandleImpl> m_impl;
3941
};
4042

4143

src/aws-cpp-sdk-s3-transfer/include/aws/s3-transfer/UploadProgressListener.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,23 +24,23 @@ class AWS_S3_TRANSFER_API UploadProgressListener {
2424
/**
2525
* Invoked exactly once when the upload begins, before any bytes have been transferred.
2626
*/
27-
virtual void OnTransferInitiated(const UploadRequest&, const UploadProgressSnapshot&) {}
27+
virtual void OnTransferInitiated(const UploadRequest& /*request*/, const UploadProgressSnapshot& /*snapshot*/) {}
2828

2929
/**
3030
* Invoked as bytes are submitted to S3. Called at least once for a successful transfer
3131
* and may be called many times depending on object size and I/O buffer sizes.
3232
*/
33-
virtual void OnBytesTransferred(const UploadRequest&, const UploadProgressSnapshot&) {}
33+
virtual void OnBytesTransferred(const UploadRequest& /*request*/, const UploadProgressSnapshot& /*snapshot*/) {}
3434

3535
/**
3636
* Invoked exactly once when the upload completes successfully.
3737
*/
38-
virtual void OnTransferComplete(const UploadRequest&, const UploadProgressSnapshot&) {}
38+
virtual void OnTransferComplete(const UploadRequest& /*request*/, const UploadProgressSnapshot& /*snapshot*/) {}
3939

4040
/**
4141
* Invoked exactly once when the upload fails or is cancelled.
4242
*/
43-
virtual void OnTransferFailed(const UploadRequest&, const UploadProgressSnapshot&) {}
43+
virtual void OnTransferFailed(const UploadRequest& /*request*/, const UploadProgressSnapshot& /*snapshot*/) {}
4444
};
4545

4646
}

src/aws-cpp-sdk-s3-transfer/include/aws/s3-transfer/UploadProgressSnapshot.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ namespace Transfer {
1717
* Immutable snapshot of upload progress passed to UploadProgressListener callbacks. Captures
1818
* bytes transferred, total bytes (known up-front for uploads), and the response once available.
1919
*/
20-
class AWS_S3_TRANSFER_API UploadProgressSnapshot {
20+
class AWS_S3_TRANSFER_API UploadProgressSnapshot final {
2121
public:
2222
UploadProgressSnapshot(uint64_t transferredBytes,
2323
uint64_t totalBytes,

src/aws-cpp-sdk-s3-transfer/include/aws/s3-transfer/UploadRequest.h

Lines changed: 14 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -21,72 +21,31 @@ namespace Transfer {
2121
* The transfer manager chooses between a single PutObject and a multipart upload based on
2222
* the configured threshold.
2323
*/
24-
class AWS_S3_TRANSFER_API UploadRequest {
24+
class AWS_S3_TRANSFER_API UploadRequest final {
2525
public:
26-
inline const Aws::S3::Model::PutObjectRequest& GetS3Request() const { return m_s3Request; }
27-
inline bool S3RequestHasBeenSet() const { return m_s3RequestHasBeenSet; }
28-
template <typename S3RequestT = Aws::S3::Model::PutObjectRequest>
29-
void SetS3Request(S3RequestT&& val) {
30-
m_s3RequestHasBeenSet = true;
31-
m_s3Request = std::forward<S3RequestT>(val);
32-
}
33-
template <typename S3RequestT = Aws::S3::Model::PutObjectRequest>
34-
UploadRequest& WithS3Request(S3RequestT&& value) {
35-
SetS3Request(std::forward<S3RequestT>(value));
36-
return *this;
37-
}
38-
39-
inline const Aws::String& GetSourceFilePath() const { return m_sourceFilePath; }
40-
inline bool SourceFilePathHasBeenSet() const { return m_sourceFilePathHasBeenSet; }
41-
template <typename SourceFilePathT = Aws::String>
42-
void SetSourceFilePath(SourceFilePathT&& value) {
43-
m_sourceFilePathHasBeenSet = true;
44-
m_sourceFilePath = std::forward<SourceFilePathT>(value);
45-
}
46-
template <typename SourceFilePathT = Aws::String>
47-
UploadRequest& WithSourceFilePath(SourceFilePathT&& value) {
48-
SetSourceFilePath(std::forward<SourceFilePathT>(value));
49-
return *this;
50-
}
51-
52-
inline const std::shared_ptr<Aws::IOStream>& GetBody() const { return m_body; }
53-
inline bool BodyHasBeenSet() const { return m_bodyHasBeenSet; }
54-
inline void SetBody(const std::shared_ptr<Aws::IOStream>& val) {
55-
m_bodyHasBeenSet = true;
56-
m_body = val;
57-
}
58-
inline UploadRequest& WithBody(const std::shared_ptr<Aws::IOStream>& val) {
59-
SetBody(val);
60-
return *this;
61-
}
26+
explicit UploadRequest(
27+
Aws::S3::Model::PutObjectRequest s3Request,
28+
Aws::String sourceFilePath,
29+
std::shared_ptr<Aws::IOStream> body,
30+
Aws::Vector<std::shared_ptr<UploadProgressListener>> transferListeners = {})
31+
: m_s3Request(std::move(s3Request)),
32+
m_sourceFilePath(std::move(sourceFilePath)),
33+
m_body(std::move(body)),
34+
m_transferListeners(std::move(transferListeners)) {}
6235

36+
inline const Aws::S3::Model::PutObjectRequest& GetS3Request() const {return m_s3Request; }
37+
inline const Aws::String& GetSourceFilePath() const {return m_sourceFilePath;}
38+
inline const std::shared_ptr<Aws::IOStream>& GetBody() const {return m_body;}
6339
inline const Aws::Vector<std::shared_ptr<UploadProgressListener>>& GetTransferListeners() const {
6440
return m_transferListeners;
6541
}
66-
inline bool TransferListenersHasBeenSet() const { return m_transferListenersHasBeenSet; }
67-
inline void SetTransferListeners(const Aws::Vector<std::shared_ptr<UploadProgressListener>>& val) {
68-
m_transferListenersHasBeenSet = true;
69-
m_transferListeners = val;
70-
}
71-
inline UploadRequest& WithTransferListeners(const Aws::Vector<std::shared_ptr<UploadProgressListener>>& val) {
72-
SetTransferListeners(val);
73-
return *this;
74-
}
75-
inline UploadRequest& AddTransferListener(const std::shared_ptr<UploadProgressListener>& listener) {
76-
m_transferListenersHasBeenSet = true;
77-
m_transferListeners.push_back(listener);
78-
return *this;
79-
}
42+
8043

8144
private:
8245
Aws::S3::Model::PutObjectRequest m_s3Request;
8346
Aws::String m_sourceFilePath;
8447
std::shared_ptr<Aws::IOStream> m_body;
8548
Aws::Vector<std::shared_ptr<UploadProgressListener>> m_transferListeners;
86-
bool m_s3RequestHasBeenSet = false;
87-
bool m_sourceFilePathHasBeenSet = false;
88-
bool m_bodyHasBeenSet = false;
89-
bool m_transferListenersHasBeenSet = false;
9049
};
9150

9251
}

0 commit comments

Comments
 (0)