NVIDIA DeepStream SDK API Reference

9.2 Release
includes/opentelemetry/sdk/resource/resource.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 #include <string>
7 
8 #include "opentelemetry/sdk/common/attribute_utils.h"
9 #include "opentelemetry/version.h"
10 
12 namespace sdk
13 {
14 namespace resource
15 {
16 
17 using ResourceAttributes = opentelemetry::sdk::common::AttributeMap;
18 
19 class Resource
20 {
21 public:
22  Resource() noexcept;
23 
24  Resource(const ResourceAttributes &attributes) noexcept;
25 
26  Resource(const ResourceAttributes &attributes, const std::string &schema_url) noexcept;
27 
28  Resource(const Resource &) = default;
29  Resource &operator=(const Resource &) = default;
30 
31  const ResourceAttributes &GetAttributes() const noexcept;
32  const std::string &GetSchemaURL() const noexcept;
33 
47  Resource Merge(const Resource &other) const noexcept;
48 
56  static Resource Create(const ResourceAttributes &attributes,
57  const std::string &schema_url = std::string{});
58 
63  static Resource &GetEmpty();
64 
69  static Resource &GetDefault();
70 
71 private:
72  ResourceAttributes attributes_;
73  std::string schema_url_;
74 };
75 
76 } // namespace resource
77 } // namespace sdk
sdk::resource::Resource::operator=
Resource & operator=(const Resource &)=default
sdk::resource::Resource::Resource
Resource() noexcept
sdk::resource::Resource::Create
static Resource Create(const ResourceAttributes &attributes, const std::string &schema_url=std::string{})
Returns a newly created Resource with the specified attributes.
sdk::resource::ResourceAttributes
opentelemetry::sdk::common::AttributeMap ResourceAttributes
Definition: includes/opentelemetry/sdk/resource/resource.h:17
OPENTELEMETRY_BEGIN_NAMESPACE
#define OPENTELEMETRY_BEGIN_NAMESPACE
Definition: includes/opentelemetry/version.h:21
sdk::resource::Resource::Merge
Resource Merge(const Resource &other) const noexcept
Returns a new, merged Resource by merging the current Resource with the other Resource.
sdk::resource::Resource::GetSchemaURL
const std::string & GetSchemaURL() const noexcept
OPENTELEMETRY_END_NAMESPACE
#define OPENTELEMETRY_END_NAMESPACE
Definition: includes/opentelemetry/version.h:24
sdk::resource::Resource::GetDefault
static Resource & GetDefault()
Returns a Resource that indentifies the SDK in use.
sdk::resource::Resource::GetAttributes
const ResourceAttributes & GetAttributes() const noexcept
sdk::resource::Resource::GetEmpty
static Resource & GetEmpty()
Returns an Empty resource.
sdk
Definition: includes/opentelemetry/sdk/common/atomic_shared_ptr.h:13
sdk::resource::Resource
Definition: includes/opentelemetry/sdk/resource/resource.h:19