Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Service Client Codegen #641

Merged
merged 19 commits into from
Oct 6, 2023
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion identity/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# This file is generated

cmake_minimum_required(VERSION 3.1)

project(IotIdentity-cpp LANGUAGES CXX)
if (DEFINED SIMPLE_VERSION)
message("Identity version is ${SIMPLE_VERSION}")
message("IotIdentity version is ${SIMPLE_VERSION}")
set(PROJECT_VERSION ${SIMPLE_VERSION})
endif()

Expand Down
2 changes: 2 additions & 0 deletions identity/cmake/iotidentity-cpp-config.cmake
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# This file is generated

include(CMakeFindDependencyMacro)

find_dependency(aws-crt-cpp)
Expand Down
2 changes: 2 additions & 0 deletions identity/include/aws/iotidentity/IotIdentityClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include <aws/crt/StlAllocator.h>
#include <aws/crt/Types.h>

#include <aws/crt/mqtt/Mqtt5Client.h>
#include <aws/crt/mqtt/MqttClient.h>

namespace Aws
Expand Down Expand Up @@ -60,6 +61,7 @@ namespace Aws
{
public:
IotIdentityClient(const std::shared_ptr<Aws::Crt::Mqtt::MqttConnection> &connection);
IotIdentityClient(const std::shared_ptr<Aws::Crt::Mqtt5::Mqtt5Client> &mqtt5Client);

operator bool() const noexcept;
int GetLastError() const noexcept;
Expand Down
5 changes: 5 additions & 0 deletions identity/source/IotIdentityClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ namespace Aws
{
}

IotIdentityClient::IotIdentityClient(const std::shared_ptr<Aws::Crt::Mqtt5::Mqtt5Client> &mqtt5Client)
{
m_connection = Aws::Crt::Mqtt::MqttConnection::NewConnectionFromMqtt5Client(mqtt5Client);
}

IotIdentityClient::operator bool() const noexcept { return m_connection && *m_connection; }

int IotIdentityClient::GetLastError() const noexcept { return aws_last_error(); }
Expand Down
4 changes: 1 addition & 3 deletions jobs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,7 @@ else ()
target_compile_options(IotJobs-cpp PRIVATE -Wall -Wno-long-long -pedantic -Werror)
endif ()

if (CMAKE_BUILD_TYPE STREQUAL "" OR CMAKE_BUILD_TYPE MATCHES Debug)
target_compile_definitions(IotJobs-cpp PRIVATE "-DDEBUG_BUILD")
endif ()
target_compile_definitions(IotJobs-cpp PRIVATE $<$<CONFIG:Debug>:DEBUG_BUILD>)

if (BUILD_SHARED_LIBS)
target_compile_definitions(IotJobs-cpp PUBLIC "-DAWS_IOTJOBS_USE_IMPORT_EXPORT")
Expand Down
2 changes: 2 additions & 0 deletions jobs/include/aws/iotjobs/IotJobsClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include <aws/crt/StlAllocator.h>
#include <aws/crt/Types.h>

#include <aws/crt/mqtt/Mqtt5Client.h>
#include <aws/crt/mqtt/MqttClient.h>

namespace Aws
Expand Down Expand Up @@ -80,6 +81,7 @@ namespace Aws
{
public:
IotJobsClient(const std::shared_ptr<Aws::Crt::Mqtt::MqttConnection> &connection);
IotJobsClient(const std::shared_ptr<Aws::Crt::Mqtt5::Mqtt5Client> &mqtt5Client);

operator bool() const noexcept;
int GetLastError() const noexcept;
Expand Down
5 changes: 5 additions & 0 deletions jobs/source/IotJobsClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ namespace Aws
{
}

IotJobsClient::IotJobsClient(const std::shared_ptr<Aws::Crt::Mqtt5::Mqtt5Client> &mqtt5Client)
{
m_connection = Aws::Crt::Mqtt::MqttConnection::NewConnectionFromMqtt5Client(mqtt5Client);
}

IotJobsClient::operator bool() const noexcept { return m_connection && *m_connection; }

int IotJobsClient::GetLastError() const noexcept { return aws_last_error(); }
Expand Down
4 changes: 3 additions & 1 deletion shadow/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# This file is generated

cmake_minimum_required(VERSION 3.1)

project(IotShadow-cpp LANGUAGES CXX)
if (DEFINED SIMPLE_VERSION)
message("Shadow version is ${SIMPLE_VERSION}")
message("IotShadow version is ${SIMPLE_VERSION}")
set(PROJECT_VERSION ${SIMPLE_VERSION})
endif()

Expand Down
2 changes: 2 additions & 0 deletions shadow/cmake/iotshadow-cpp-config.cmake
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# This file is generated

include(CMakeFindDependencyMacro)

find_dependency(aws-crt-cpp)
Expand Down
2 changes: 2 additions & 0 deletions shadow/include/aws/iotshadow/IotShadowClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include <aws/crt/StlAllocator.h>
#include <aws/crt/Types.h>

#include <aws/crt/mqtt/Mqtt5Client.h>
#include <aws/crt/mqtt/MqttClient.h>

namespace Aws
Expand Down Expand Up @@ -103,6 +104,7 @@ namespace Aws
{
public:
IotShadowClient(const std::shared_ptr<Aws::Crt::Mqtt::MqttConnection> &connection);
IotShadowClient(const std::shared_ptr<Aws::Crt::Mqtt5::Mqtt5Client> &mqtt5Client);

operator bool() const noexcept;
int GetLastError() const noexcept;
Expand Down
5 changes: 5 additions & 0 deletions shadow/source/IotShadowClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ namespace Aws
{
}

IotShadowClient::IotShadowClient(const std::shared_ptr<Aws::Crt::Mqtt5::Mqtt5Client> &mqtt5Client)
{
m_connection = Aws::Crt::Mqtt::MqttConnection::NewConnectionFromMqtt5Client(mqtt5Client);
}

IotShadowClient::operator bool() const noexcept { return m_connection && *m_connection; }

int IotShadowClient::GetLastError() const noexcept { return aws_last_error(); }
Expand Down
Loading