Classes | |
| class | OptionValue |
| Configuration option value. More... | |
| class | Options |
| Manages configuration options for RapidsMPF operations. More... | |
Typedefs | |
| template<typename T > | |
| using | OptionFactory = std::function< T(std::string const &)> |
| Type alias for a factory function that constructs options from strings. More... | |
Functions | |
| void | get_environment_variables (std::unordered_map< std::string, std::string > &output, std::string const &key_regex="RAPIDSMPF_(.*)") |
| Populates a map with environment variables matching a given regular expression. More... | |
| std::unordered_map< std::string, std::string > | get_environment_variables (std::string const &key_regex="RAPIDSMPF_(.*)") |
| Returns a map of environment variables matching a given regular expression. More... | |
SPDX-FileCopyrightText: Copyright (c) 2025, NVIDIA CORPORATION & AFFILIATES. SPDX-License-Identifier: Apache-2.0
| using rapidsmpf::config::OptionFactory = typedef std::function<T(std::string const&)> |
Type alias for a factory function that constructs options from strings.
The factory receives the string representation of an option value and returns an instance of the option type. If the option is unset, the function receives an empty string and should either return a meaningful default value or throw std::invalid_argument.
Definition at line 32 of file config.hpp.
| std::unordered_map<std::string, std::string> rapidsmpf::config::get_environment_variables | ( | std::string const & | key_regex = "RAPIDSMPF_(.*)" | ) |
Returns a map of environment variables matching a given regular expression.
This is a convenience overload. See the documentation for the first variant of get_environment_variables() for details on matching and behavior.
| key_regex | A regular expression with a single capture group to match and extract the environment variable keys. |
| std::invalid_argument | If key_regex doesn't contain exactly one capture group. |
| void rapidsmpf::config::get_environment_variables | ( | std::unordered_map< std::string, std::string > & | output, |
| std::string const & | key_regex = "RAPIDSMPF_(.*)" |
||
| ) |
Populates a map with environment variables matching a given regular expression.
This function scans the current process's environment variables and inserts those whose keys match the provided regular expression into the output map. Only variables with keys not already present in output are inserted; existing keys are left unchanged.
The key_regex should contain a single capture group that extracts the portion of the environment variable key you want to use as the map key. For example, to strip the RAPIDSMPF_ prefix, use RAPIDSMPF_(.*) as the regex. The captured group will be used as the key in the output map.
Example:
| [out] | output | The map to populate with matching environment variables. Only keys that do not already exist in the map will be added. |
| [in] | key_regex | A regular expression with a single capture group to match and extract the environment variable keys. Only environment variables with keys matching this pattern will be considered. |
| std::invalid_argument | If key_regex doesn't contain exactly one capture group. |
std::regex and relies on the global environ symbol, which is POSIX-specific and is not thread-safe.