From 0e53bfa5b9e3ba9a5c22ce977d3fbc0a713dc37b Mon Sep 17 00:00:00 2001 From: Bret Ambrose Date: Wed, 18 Sep 2024 13:32:22 -0700 Subject: [PATCH] Stream creation signature update --- include/aws/iot/MqttRequestResponseClient.h | 2 +- source/iot/MqttRequestResponseClient.cpp | 24 ++++++++++----------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/include/aws/iot/MqttRequestResponseClient.h b/include/aws/iot/MqttRequestResponseClient.h index 92d16c8d4..ca0696622 100644 --- a/include/aws/iot/MqttRequestResponseClient.h +++ b/include/aws/iot/MqttRequestResponseClient.h @@ -213,7 +213,7 @@ namespace Aws const aws_mqtt_request_operation_options &requestOptions, UnmodeledResultHandler &&resultHandler) = 0; - virtual std::shared_ptr createStream(StreamingOperationOptions &&options) = 0; + virtual std::shared_ptr createStream(const StreamingOperationOptions &options) = 0; static IMqttRequestResponseClient *newFrom5( const Aws::Crt::Mqtt5::Mqtt5Client &protocolClient, diff --git a/source/iot/MqttRequestResponseClient.cpp b/source/iot/MqttRequestResponseClient.cpp index 21499e3fc..e40a463f1 100644 --- a/source/iot/MqttRequestResponseClient.cpp +++ b/source/iot/MqttRequestResponseClient.cpp @@ -77,7 +77,7 @@ namespace Aws public: StreamingOperationImpl( struct aws_mqtt_rr_client_operation *stream, - StreamingOperationOptions &&options, + const StreamingOperationOptions &options, struct aws_event_loop *protocolLoop); virtual ~StreamingOperationImpl(); @@ -113,9 +113,9 @@ namespace Aws StreamingOperationImpl::StreamingOperationImpl( struct aws_mqtt_rr_client_operation *stream, - StreamingOperationOptions &&options, + const StreamingOperationOptions &options, struct aws_event_loop *protocolLoop) - : m_config(std::move(options)), m_stream(stream), m_protocolLoop(protocolLoop), m_lock(), + : m_config(options), m_stream(stream), m_protocolLoop(protocolLoop), m_lock(), m_closed(false) { aws_rw_lock_init(&m_lock); @@ -217,7 +217,7 @@ namespace Aws public: static std::shared_ptr create( Aws::Crt::Allocator *allocator, - StreamingOperationOptions &&options, + const StreamingOperationOptions &options, struct aws_mqtt_request_response_client *client); StreamingOperation(const std::shared_ptr &impl); @@ -235,7 +235,7 @@ namespace Aws std::shared_ptr StreamingOperation::create( Aws::Crt::Allocator *allocator, - StreamingOperationOptions &&options, + const StreamingOperationOptions &options, struct aws_mqtt_request_response_client *client) { StreamingOperationImplHandle *implHandle = Aws::Crt::New(allocator); @@ -256,7 +256,7 @@ namespace Aws } auto impl = Aws::Crt::MakeShared( - allocator, stream, std::move(options), aws_mqtt_request_response_client_get_event_loop(client)); + allocator, stream, options, aws_mqtt_request_response_client_get_event_loop(client)); auto streamingOperation = Aws::Crt::MakeShared(allocator, impl); return streamingOperation; @@ -334,7 +334,7 @@ namespace Aws const aws_mqtt_request_operation_options &requestOptions, UnmodeledResultHandler &&resultHandler) noexcept; - std::shared_ptr createStream(StreamingOperationOptions &&options); + std::shared_ptr createStream(const StreamingOperationOptions &options); Aws::Crt::Allocator *getAllocator() const { return m_allocator; } @@ -387,9 +387,9 @@ namespace Aws } std::shared_ptr MqttRequestResponseClientImpl::createStream( - StreamingOperationOptions &&options) + const StreamingOperationOptions &options) { - return StreamingOperation::create(m_allocator, std::move(options), m_client); + return StreamingOperation::create(m_allocator, options, m_client); } ////////////////////////////////////////////////////////// @@ -411,7 +411,7 @@ namespace Aws const aws_mqtt_request_operation_options &requestOptions, UnmodeledResultHandler &&resultHandler); - std::shared_ptr createStream(StreamingOperationOptions &&options); + std::shared_ptr createStream(const StreamingOperationOptions &options); private: MqttRequestResponseClientImpl *m_impl; @@ -483,9 +483,9 @@ namespace Aws } std::shared_ptr MqttRequestResponseClient::createStream( - StreamingOperationOptions &&options) + const StreamingOperationOptions &options) { - return m_impl->createStream(std::move(options)); + return m_impl->createStream(options); } MqttRequestResponseClient::MqttRequestResponseClient(MqttRequestResponseClientImpl *impl) : m_impl(impl) {}