NVIDIA DeepStream SDK API Reference
9.2 Release
9.2/includes/opentelemetry/baggage/baggage_context.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/baggage/baggage.h"
7
#include "opentelemetry/context/context.h"
8
#include "opentelemetry/nostd/shared_ptr.h"
9
#include "opentelemetry/version.h"
10
11
OPENTELEMETRY_BEGIN_NAMESPACE
12
13
namespace
baggage
14
{
15
16
static
const
std::string
kBaggageHeader
=
"baggage"
;
17
18
inline
nostd::shared_ptr<Baggage>
GetBaggage
(
const
context::Context
&
context
) noexcept
19
{
20
context::ContextValue
context_value =
context
.GetValue(
kBaggageHeader
);
21
if
(
nostd::holds_alternative
<
nostd::shared_ptr<Baggage>
>(context_value))
22
{
23
return
nostd::get<nostd::shared_ptr<Baggage>>(context_value);
24
}
25
static
nostd::shared_ptr<Baggage>
empty_baggage{
new
Baggage
()};
26
return
empty_baggage;
27
}
28
29
inline
context::Context
SetBaggage
(
context::Context
&
context
,
30
const
nostd::shared_ptr<Baggage>
&
baggage
) noexcept
31
{
32
return
context
.SetValue(
kBaggageHeader
,
baggage
);
33
}
34
35
}
// namespace baggage
36
OPENTELEMETRY_END_NAMESPACE
baggage::GetBaggage
nostd::shared_ptr< Baggage > GetBaggage(const context::Context &context) noexcept
Definition:
includes/opentelemetry/baggage/baggage_context.h:18
absl::OTABSL_OPTION_NAMESPACE_NAME::variant
Definition:
includes/opentelemetry/nostd/variant.h:61
baggage
Definition:
includes/opentelemetry/baggage/baggage.h:16
nostd::shared_ptr
Provide a type-erased version of std::shared_ptr that has ABI stability.
Definition:
includes/opentelemetry/nostd/shared_ptr.h:28
OPENTELEMETRY_BEGIN_NAMESPACE
#define OPENTELEMETRY_BEGIN_NAMESPACE
Definition:
includes/opentelemetry/version.h:21
context
Definition:
includes/opentelemetry/context/context.h:16
baggage::Baggage
Definition:
includes/opentelemetry/baggage/baggage.h:19
baggage::SetBaggage
context::Context SetBaggage(context::Context &context, const nostd::shared_ptr< Baggage > &baggage) noexcept
Definition:
includes/opentelemetry/baggage/baggage_context.h:29
baggage::kBaggageHeader
static const std::string kBaggageHeader
Definition:
includes/opentelemetry/baggage/baggage_context.h:16
OPENTELEMETRY_END_NAMESPACE
#define OPENTELEMETRY_END_NAMESPACE
Definition:
includes/opentelemetry/version.h:24
context::Context
Definition:
includes/opentelemetry/context/context.h:23
nostd::holds_alternative
constexpr bool holds_alternative(const variant< Ts... > &v) noexcept
Definition:
includes/opentelemetry/std/variant.h:218
Privacy Policy
|
Your Privacy Choices
|
Terms of Service
|
Accessibility
|
Corporate Policies
|
Product Security
|
Contact
© 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
NVIDIA Confidential | Subject to Change | For test and development only.
Wed Oct 28 2026 12:02:00 | PR-09318-R32