Bifrost SDK
Bifrost SDK documentation
BifrostGraph::Executor::Utility::ConfigEnv Class Referencefinal

ConfigEnv represents a map containing (key, values) pairs describing the current Bifrost configuration from known environment variables. More...

#include <Utility.h>

Public Member Functions

 EXECUTOR_DECLARE_MAKE_OWNER_FRIENDSHIP ()
 Allow the makeOwner<> factory functions to access the constructor of this class. More...
 
 ~ConfigEnv () noexcept
 Destructor. More...
 
bool isValid () const noexcept
 Check if this ConfigEnv has been successfully initialized. More...
 
bool hasKey (const Amino::String &key) const noexcept
 Check if a known Bifrost environment variable with name key is set. More...
 
const StringArrayvalues (const Amino::String &key) const noexcept
 Get the string values for a known Bifrost environment variable with name key. More...
 

Protected Member Functions

 ConfigEnv () noexcept
 

Detailed Description

ConfigEnv represents a map containing (key, values) pairs describing the current Bifrost configuration from known environment variables.

The Environment Variable Name: The (key, values) Pair:
BIFROST_DISABLE_PACKS

("bifrost_disable_packs", StringArray)

No (key,values) pair is added to the ConfigEnv if the EV is not set. Otherwise, values contains the names of the Bifrost packs to be disabled, as listed in the environment variable. The empty pack names and duplicate pack names are eliminated.

BIFROST_LIB_CONFIG_FILES

("bifrost_pack_config_files", StringArray)

No (key,values) pair is added to the ConfigEnv if the EV is not set. Otherwise, values contains the paths to the Bifrost config files to be loaded by Bifrost, as listed in the environment variable. Empty pathnames are eliminated. Duplicates of identical pathnames are eliminated, but no attempt is made to eliminate duplicates of non-identical pathnames that are equivalent (e.g. /dir/a.json and /dir/./a.json, or different symbolic links that refer to the same file).

Definition at line 152 of file Utility.h.

Constructor & Destructor Documentation

◆ ConfigEnv()

BifrostGraph::Executor::Utility::ConfigEnv::ConfigEnv ( )
protectednoexcept

◆ ~ConfigEnv()

BifrostGraph::Executor::Utility::ConfigEnv::~ConfigEnv ( )
noexcept

Destructor.

Member Function Documentation

◆ EXECUTOR_DECLARE_MAKE_OWNER_FRIENDSHIP()

BifrostGraph::Executor::Utility::ConfigEnv::EXECUTOR_DECLARE_MAKE_OWNER_FRIENDSHIP ( )

Allow the makeOwner<> factory functions to access the constructor of this class.

◆ hasKey()

bool BifrostGraph::Executor::Utility::ConfigEnv::hasKey ( const Amino::String key) const
noexcept

Check if a known Bifrost environment variable with name key is set.

Parameters
[in]keyThe name of an environment variable
Returns
true if this ConfigEnv is valid and if key is the name of a known Bifrost environment variable and if this environment variable is set; false otherwise.

◆ isValid()

bool BifrostGraph::Executor::Utility::ConfigEnv::isValid ( ) const
noexcept

Check if this ConfigEnv has been successfully initialized.

Note
If not valid, all future operations on this ConfigEnv will fail.
Returns
true if this ConfigEnv has been successfully initialized and is ready to be used; false otherwise.

◆ values()

const StringArray & BifrostGraph::Executor::Utility::ConfigEnv::values ( const Amino::String key) const
noexcept

Get the string values for a known Bifrost environment variable with name key.

Parameters
[in]keyThe name of an environment variable
Returns
The string values of a known Bifrost environment variable with name key if it is set and if this ConfigEnv is valid; an empty array if key is not a known Bifrost environment variable, or if this environment variable is not set, or if this ConfigEnv is invalid.