|
|
NVIDIA DeepStream SDK API Reference
|
9.2 Release
|
Go to the documentation of this file.
9 #include "opentelemetry/common/key_value_iterable_view.h"
10 #include "opentelemetry/nostd/string_view.h"
11 #include "opentelemetry/nostd/type_traits.h"
12 #include "opentelemetry/nostd/unique_ptr.h"
13 #include "opentelemetry/nostd/variant.h"
14 #include "opentelemetry/sdk/common/attribute_utils.h"
15 #include "opentelemetry/version.h"
21 namespace instrumentationscope
82 const ArgumentType &arg)
89 for (
auto &argv : arg)
91 result->SetAttribute(argv.first, argv.second);
97 std::size_t
HashCode() const noexcept {
return hash_code_; }
106 return this->name_ == other.name_ && this->version_ == other.version_ &&
107 this->schema_url_ == other.schema_url_ && this->attributes_ == other.attributes_;
123 const opentelemetry::common::KeyValueIterable *attributes =
nullptr) const noexcept
126 if (this->name_ != name || this->version_ !=
version || this->schema_url_ != schema_url)
131 if (attributes ==
nullptr)
133 if (attributes_.empty())
140 return attributes_.EqualTo(*attributes);
143 const std::string &
GetName() const noexcept {
return name_; }
144 const std::string &
GetVersion() const noexcept {
return version_; }
145 const std::string &
GetSchemaURL() const noexcept {
return schema_url_; }
151 attributes_[std::string(key)] =
152 nostd::visit(opentelemetry::sdk::common::AttributeConverter(), value);
160 : name_(name), version_(
version), schema_url_(schema_url), attributes_(
std::move(attributes))
162 std::string hash_data;
163 hash_data.reserve(name_.size() + version_.size() + schema_url_.size());
165 hash_data += version_;
166 hash_data += schema_url_;
167 hash_code_ = std::hash<std::string>{}(hash_data);
172 std::string version_;
173 std::string schema_url_;
174 std::size_t hash_code_;
bool operator==(const InstrumentationScope &other) const noexcept
Compare 2 instrumentation libraries.
Provide a simplified port of std::unique_ptr that has ABI stability.
#define OPENTELEMETRY_BEGIN_NAMESPACE
const std::string & GetName() const noexcept
InstrumentationScope(const InstrumentationScope &)=default
nostd::variant< bool, int32_t, int64_t, uint32_t, double, const char *, nostd::string_view, nostd::span< const bool >, nostd::span< const int32_t >, nostd::span< const int64_t >, nostd::span< const uint32_t >, nostd::span< const double >, nostd::span< const nostd::string_view >, uint64_t, nostd::span< const uint64_t >, nostd::span< const uint8_t > > AttributeValue
OpenTelemetry signals can be enriched by adding attributes.
opentelemetry::sdk::common::AttributeMap InstrumentationScopeAttributes
#define OPENTELEMETRY_END_NAMESPACE
constexpr absl::OTABSL_OPTION_NAMESPACE_NAME::remove_reference_t< T > && move(T &&t) noexcept
constexpr const char * size
const std::string & GetSchemaURL() const noexcept
constexpr auto visit(_Callable &&_Obj, _Variants &&..._Args)
typename std::enable_if< B, T >::type enable_if_t
Back port of std::enable_if_t.
static nostd::unique_ptr< InstrumentationScope > Create(nostd::string_view name, nostd::string_view version, nostd::string_view schema_url, const ArgumentType &arg)
Returns a newly created InstrumentationScope with the specified library name and version.
static nostd::unique_ptr< InstrumentationScope > Create(nostd::string_view name, nostd::string_view version, nostd::string_view schema_url, const InstrumentationScopeAttributes &attributes)
Returns a newly created InstrumentationScope with the specified library name and version.
const InstrumentationScopeAttributes & GetAttributes() const noexcept
static nostd::unique_ptr< InstrumentationScope > Create(nostd::string_view name, nostd::string_view version="", nostd::string_view schema_url="", InstrumentationScopeAttributes &&attributes={})
Returns a newly created InstrumentationScope with the specified library name and version.
std::size_t HashCode() const noexcept
bool equal(const nostd::string_view name, const nostd::string_view version, const nostd::string_view schema_url="", const opentelemetry::common::KeyValueIterable *attributes=nullptr) const noexcept
Check whether the instrumentation scope has given name and version.
const std::string & GetVersion() const noexcept
Back port of std::string_view to work with pre-cpp-17 compilers.
void SetAttribute(nostd::string_view key, const opentelemetry::common::AttributeValue &value) noexcept