NVIDIA DeepStream SDK API Reference

9.2 Release
9.2/includes/opentelemetry/plugin/detail/utility.h
Go to the documentation of this file.
1 // Copyright The OpenTelemetry Authors
2 // SPDX-License-Identifier: Apache-2.0
3 
4 #pragma once
5 
6 #if __EXCEPTIONS
7 # include <new>
8 #endif // __EXCEPTIONS
9 
10 #include <string>
11 
12 #include "opentelemetry/version.h"
13 
15 namespace plugin
16 {
17 namespace detail
18 {
19 inline void CopyErrorMessage(const char *source, std::string &destination) noexcept
20 #if __EXCEPTIONS
21 try
22 #endif
23 {
24  if (source == nullptr)
25  {
26  return;
27  }
28  destination.assign(source);
29 }
30 #if __EXCEPTIONS
31 catch (const std::bad_alloc &)
32 {}
33 #endif
34 } // namespace detail
35 } // namespace plugin
OPENTELEMETRY_BEGIN_NAMESPACE
#define OPENTELEMETRY_BEGIN_NAMESPACE
Definition: includes/opentelemetry/version.h:21
OPENTELEMETRY_END_NAMESPACE
#define OPENTELEMETRY_END_NAMESPACE
Definition: includes/opentelemetry/version.h:24
plugin
Definition: includes/opentelemetry/plugin/dynamic_load.h:19
plugin::detail::CopyErrorMessage
void CopyErrorMessage(const char *source, std::string &destination) noexcept
Definition: includes/opentelemetry/plugin/detail/utility.h:19