Skip to content

Commit

Permalink
Stream creation signature update
Browse files Browse the repository at this point in the history
  • Loading branch information
bretambrose committed Sep 18, 2024
1 parent fd25b31 commit 0e53bfa
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion include/aws/iot/MqttRequestResponseClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ namespace Aws
const aws_mqtt_request_operation_options &requestOptions,
UnmodeledResultHandler &&resultHandler) = 0;

virtual std::shared_ptr<IStreamingOperation> createStream(StreamingOperationOptions &&options) = 0;
virtual std::shared_ptr<IStreamingOperation> createStream(const StreamingOperationOptions &options) = 0;

static IMqttRequestResponseClient *newFrom5(
const Aws::Crt::Mqtt5::Mqtt5Client &protocolClient,
Expand Down
24 changes: 12 additions & 12 deletions source/iot/MqttRequestResponseClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -217,7 +217,7 @@ namespace Aws
public:
static std::shared_ptr<IStreamingOperation> create(
Aws::Crt::Allocator *allocator,
StreamingOperationOptions &&options,
const StreamingOperationOptions &options,
struct aws_mqtt_request_response_client *client);

StreamingOperation(const std::shared_ptr<StreamingOperationImpl> &impl);
Expand All @@ -235,7 +235,7 @@ namespace Aws

std::shared_ptr<IStreamingOperation> StreamingOperation::create(
Aws::Crt::Allocator *allocator,
StreamingOperationOptions &&options,
const StreamingOperationOptions &options,
struct aws_mqtt_request_response_client *client)
{
StreamingOperationImplHandle *implHandle = Aws::Crt::New<StreamingOperationImplHandle>(allocator);
Expand All @@ -256,7 +256,7 @@ namespace Aws
}

auto impl = Aws::Crt::MakeShared<StreamingOperationImpl>(
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<StreamingOperation>(allocator, impl);

return streamingOperation;
Expand Down Expand Up @@ -334,7 +334,7 @@ namespace Aws
const aws_mqtt_request_operation_options &requestOptions,
UnmodeledResultHandler &&resultHandler) noexcept;

std::shared_ptr<IStreamingOperation> createStream(StreamingOperationOptions &&options);
std::shared_ptr<IStreamingOperation> createStream(const StreamingOperationOptions &options);

Aws::Crt::Allocator *getAllocator() const { return m_allocator; }

Expand Down Expand Up @@ -387,9 +387,9 @@ namespace Aws
}

std::shared_ptr<IStreamingOperation> 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);
}

//////////////////////////////////////////////////////////
Expand All @@ -411,7 +411,7 @@ namespace Aws
const aws_mqtt_request_operation_options &requestOptions,
UnmodeledResultHandler &&resultHandler);

std::shared_ptr<IStreamingOperation> createStream(StreamingOperationOptions &&options);
std::shared_ptr<IStreamingOperation> createStream(const StreamingOperationOptions &options);

private:
MqttRequestResponseClientImpl *m_impl;
Expand Down Expand Up @@ -483,9 +483,9 @@ namespace Aws
}

std::shared_ptr<IStreamingOperation> 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) {}
Expand Down

0 comments on commit 0e53bfa

Please sign in to comment.