NVIDIA DeepStream SDK API Reference

9.2 Release
includes/opentelemetry/common/key_value_iterable.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 "opentelemetry/common/attribute_value.h"
7 #include "opentelemetry/nostd/function_ref.h"
8 #include "opentelemetry/nostd/string_view.h"
9 #include "opentelemetry/version.h"
10 
12 namespace common
13 {
18 {
19 public:
20  virtual ~KeyValueIterable() = default;
21 
29  callback) const noexcept = 0;
30 
34  virtual size_t size() const noexcept = 0;
35 };
36 
41 {
42 public:
43  ~NoopKeyValueIterable() override = default;
44 
51  const noexcept override
52  {
53  return true;
54  }
55 
59  size_t size() const noexcept override { return 0; }
60 };
61 
62 } // namespace common
nostd::function_ref
Definition: includes/opentelemetry/nostd/function_ref.h:17
common::NoopKeyValueIterable
Supports internal iteration over a collection of key-value pairs.
Definition: includes/opentelemetry/common/key_value_iterable.h:40
absl::OTABSL_OPTION_NAMESPACE_NAME::variant
Definition: includes/opentelemetry/nostd/variant.h:61
common::NoopKeyValueIterable::~NoopKeyValueIterable
~NoopKeyValueIterable() override=default
common::KeyValueIterable::size
virtual size_t size() const noexcept=0
OPENTELEMETRY_BEGIN_NAMESPACE
#define OPENTELEMETRY_BEGIN_NAMESPACE
Definition: includes/opentelemetry/version.h:21
common::KeyValueIterable::~KeyValueIterable
virtual ~KeyValueIterable()=default
common::KeyValueIterable::ForEachKeyValue
virtual bool ForEachKeyValue(nostd::function_ref< bool(nostd::string_view, common::AttributeValue)> callback) const noexcept=0
Iterate over key-value pairs.
OPENTELEMETRY_END_NAMESPACE
#define OPENTELEMETRY_END_NAMESPACE
Definition: includes/opentelemetry/version.h:24
common::KeyValueIterable
Supports internal iteration over a collection of key-value pairs.
Definition: includes/opentelemetry/common/key_value_iterable.h:17
common::NoopKeyValueIterable::size
size_t size() const noexcept override
Definition: includes/opentelemetry/common/key_value_iterable.h:59
common::NoopKeyValueIterable::ForEachKeyValue
bool ForEachKeyValue(nostd::function_ref< bool(nostd::string_view, common::AttributeValue)>) const noexcept override
No-op implementation: does not invoke the callback, even if key-value pairs are present.
Definition: includes/opentelemetry/common/key_value_iterable.h:49
common
Definition: includes/opentelemetry/common/attribute_value.h:14
nostd::string_view
Back port of std::string_view to work with pre-cpp-17 compilers.
Definition: includes/opentelemetry/nostd/string_view.h:37