Teuchos Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Teuchos_EnvVariables.hpp
Go to the documentation of this file.
1 // @HEADER
2 // *****************************************************************************
3 // Teuchos: Common Tools Package
4 //
5 // Copyright 2004 NTESS and the Teuchos contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9 
10 #ifndef TEUCHOS_ENVVARIABLES_HPP
11 #define TEUCHOS_ENVVARIABLES_HPP
12 
13 #include <string_view>
14 
15 namespace Teuchos {
16 
17 template <typename T>
18 T getEnvironmentVariable(const std::string_view environmentVariableName,
19  const T defaultValue);
20 
22  const char name[], bool &initialized, const char environmentVariableName[],
23  const bool defaultValue);
24 
36 template <typename T>
38  T &value, bool &initialized, const std::string_view environmentVariableName,
39  const T defaultValue);
40 
41 } // namespace Teuchos
42 
43 #endif
bool idempotentlyGetNamedEnvironmentVariableAsBool(const char name[], bool &initialized, const char environmentVariableName[], const bool defaultValue)
T idempotentlyGetEnvironmentVariable(T &value, bool &initialized, const std::string_view environmentVariableName, const T defaultValue)
Read a variable from the environment. Example usage:
T getEnvironmentVariable(const std::string_view environmentVariableName, const T defaultValue)