Skip to content

Commit d1dc649

Browse files
committed
fix clang-tidy cppcoreguidelines-special-member-functions warnings in otlp http
1 parent 235d081 commit d1dc649

11 files changed

+12
-36
lines changed

exporters/otlp/include/opentelemetry/exporters/otlp/otlp_http_client.h

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,10 @@ class OtlpHttpClient
159159
explicit OtlpHttpClient(OtlpHttpClientOptions &&options);
160160

161161
~OtlpHttpClient();
162+
OtlpHttpClient(const OtlpHttpClient &) = delete;
163+
OtlpHttpClient &operator=(const OtlpHttpClient &) = delete;
164+
OtlpHttpClient(OtlpHttpClient &&) = delete;
165+
OtlpHttpClient &operator=(OtlpHttpClient &&) = delete;
162166

163167
/**
164168
* Sync export
@@ -230,28 +234,13 @@ class OtlpHttpClient
230234
std::shared_ptr<opentelemetry::ext::http::client::Session> session;
231235
std::shared_ptr<opentelemetry::ext::http::client::EventHandler> event_handle;
232236

233-
inline HttpSessionData() = default;
234-
235-
inline explicit HttpSessionData(
236-
std::shared_ptr<opentelemetry::ext::http::client::Session> &&input_session,
237-
std::shared_ptr<opentelemetry::ext::http::client::EventHandler> &&input_handle)
237+
explicit HttpSessionData(
238+
std::shared_ptr<opentelemetry::ext::http::client::Session> input_session,
239+
std::shared_ptr<opentelemetry::ext::http::client::EventHandler> input_handle)
238240
{
239241
session.swap(input_session);
240242
event_handle.swap(input_handle);
241243
}
242-
243-
inline HttpSessionData(HttpSessionData &&other)
244-
{
245-
session.swap(other.session);
246-
event_handle.swap(other.event_handle);
247-
}
248-
249-
inline HttpSessionData &operator=(HttpSessionData &&other) noexcept
250-
{
251-
session.swap(other.session);
252-
event_handle.swap(other.event_handle);
253-
return *this;
254-
}
255244
};
256245

257246
/**

exporters/otlp/include/opentelemetry/exporters/otlp/otlp_http_exporter_options.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ namespace otlp
3333
struct OPENTELEMETRY_EXPORT OtlpHttpExporterOptions
3434
{
3535
OtlpHttpExporterOptions();
36-
~OtlpHttpExporterOptions();
3736

3837
/** The endpoint to export to. */
3938
std::string url;

exporters/otlp/include/opentelemetry/exporters/otlp/otlp_http_exporter_runtime_options.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ namespace otlp
1919
*/
2020
struct OPENTELEMETRY_EXPORT OtlpHttpExporterRuntimeOptions
2121
{
22-
OtlpHttpExporterRuntimeOptions() = default;
23-
~OtlpHttpExporterRuntimeOptions() = default;
22+
OtlpHttpExporterRuntimeOptions() = default;
2423

2524
std::shared_ptr<sdk::common::ThreadInstrumentation> thread_instrumentation =
2625
std::shared_ptr<sdk::common::ThreadInstrumentation>(nullptr);

exporters/otlp/include/opentelemetry/exporters/otlp/otlp_http_log_record_exporter_options.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ namespace otlp
3333
struct OPENTELEMETRY_EXPORT OtlpHttpLogRecordExporterOptions
3434
{
3535
OtlpHttpLogRecordExporterOptions();
36-
~OtlpHttpLogRecordExporterOptions();
3736

3837
/** The endpoint to export to. */
3938
std::string url;

exporters/otlp/include/opentelemetry/exporters/otlp/otlp_http_log_record_exporter_runtime_options.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ namespace otlp
1919
*/
2020
struct OPENTELEMETRY_EXPORT OtlpHttpLogRecordExporterRuntimeOptions
2121
{
22-
OtlpHttpLogRecordExporterRuntimeOptions() = default;
23-
~OtlpHttpLogRecordExporterRuntimeOptions() = default;
22+
OtlpHttpLogRecordExporterRuntimeOptions() = default;
2423

2524
std::shared_ptr<sdk::common::ThreadInstrumentation> thread_instrumentation =
2625
std::shared_ptr<sdk::common::ThreadInstrumentation>(nullptr);

exporters/otlp/include/opentelemetry/exporters/otlp/otlp_http_metric_exporter_options.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ namespace otlp
3434
struct OPENTELEMETRY_EXPORT OtlpHttpMetricExporterOptions
3535
{
3636
OtlpHttpMetricExporterOptions();
37-
~OtlpHttpMetricExporterOptions();
3837

3938
/** The endpoint to export to. */
4039
std::string url;

exporters/otlp/include/opentelemetry/exporters/otlp/otlp_http_metric_exporter_runtime_options.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ namespace otlp
1919
*/
2020
struct OPENTELEMETRY_EXPORT OtlpHttpMetricExporterRuntimeOptions
2121
{
22-
OtlpHttpMetricExporterRuntimeOptions() = default;
23-
~OtlpHttpMetricExporterRuntimeOptions() = default;
22+
OtlpHttpMetricExporterRuntimeOptions() = default;
2423

2524
std::shared_ptr<sdk::common::ThreadInstrumentation> thread_instrumentation =
2625
std::shared_ptr<sdk::common::ThreadInstrumentation>(nullptr);

exporters/otlp/src/otlp_http_client.cc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1000,9 +1000,8 @@ OtlpHttpClient::createSession(
10001000

10011001
// Returns the created session data
10021002
return HttpSessionData{
1003-
std::move(session),
1004-
std::shared_ptr<opentelemetry::ext::http::client::EventHandler>{
1005-
new ResponseHandler(std::move(result_callback), options_.console_debug)}};
1003+
session, std::shared_ptr<opentelemetry::ext::http::client::EventHandler>{
1004+
new ResponseHandler(std::move(result_callback), options_.console_debug)}};
10061005
}
10071006

10081007
void OtlpHttpClient::addSession(HttpSessionData &&session_data) noexcept

exporters/otlp/src/otlp_http_exporter_options.cc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@ OtlpHttpExporterOptions::OtlpHttpExporterOptions()
4343
retry_policy_backoff_multiplier(GetOtlpDefaultTracesRetryBackoffMultiplier())
4444
{}
4545

46-
OtlpHttpExporterOptions::~OtlpHttpExporterOptions() {}
47-
4846
} // namespace otlp
4947
} // namespace exporter
5048
OPENTELEMETRY_END_NAMESPACE

exporters/otlp/src/otlp_http_log_record_exporter_options.cc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@ OtlpHttpLogRecordExporterOptions::OtlpHttpLogRecordExporterOptions()
4343
retry_policy_backoff_multiplier(GetOtlpDefaultLogsRetryBackoffMultiplier())
4444
{}
4545

46-
OtlpHttpLogRecordExporterOptions::~OtlpHttpLogRecordExporterOptions() {}
47-
4846
} // namespace otlp
4947
} // namespace exporter
5048
OPENTELEMETRY_END_NAMESPACE

0 commit comments

Comments
 (0)