NVIDIA DeepStream SDK API Reference

9.2 Release
includes/opentelemetry/sdk/common/env_variables.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 <chrono>
7 #include <cstdint>
8 #include <string>
9 
10 #include "opentelemetry/version.h"
11 
13 namespace sdk
14 {
15 namespace common
16 {
17 
24 bool GetBoolEnvironmentVariable(const char *env_var_name, bool &value);
25 
32 bool GetDurationEnvironmentVariable(const char *env_var_name,
33  std::chrono::system_clock::duration &value);
34 
41 bool GetStringEnvironmentVariable(const char *env_var_name, std::string &value);
42 
49 bool GetUintEnvironmentVariable(const char *env_var_name, std::uint32_t &value);
50 
57 bool GetFloatEnvironmentVariable(const char *env_var_name, float &value);
58 
59 #if defined(_MSC_VER)
60 inline int setenv(const char *name, const char *value, int)
61 {
62  return _putenv_s(name, value);
63 }
64 
65 inline int unsetenv(const char *name)
66 {
67  return setenv(name, "", 1);
68 }
69 #endif
70 
71 } // namespace common
72 } // namespace sdk
sdk::common::GetUintEnvironmentVariable
bool GetUintEnvironmentVariable(const char *env_var_name, std::uint32_t &value)
Read a uint32_t environment variable.
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
sdk::common::GetFloatEnvironmentVariable
bool GetFloatEnvironmentVariable(const char *env_var_name, float &value)
Read a float environment variable.
sdk::common::GetStringEnvironmentVariable
bool GetStringEnvironmentVariable(const char *env_var_name, std::string &value)
Read a string environment variable.
sdk
Definition: includes/opentelemetry/sdk/common/atomic_shared_ptr.h:13
sdk::common::GetBoolEnvironmentVariable
bool GetBoolEnvironmentVariable(const char *env_var_name, bool &value)
Read a boolean environment variable.
sdk::common::GetDurationEnvironmentVariable
bool GetDurationEnvironmentVariable(const char *env_var_name, std::chrono::system_clock::duration &value)
Read a duration environment variable.
common
Definition: includes/opentelemetry/common/attribute_value.h:14