This class is a proxy for working with folly::settings represented as strings. It can apply changes to these folly::settings via snapshot provided by user. Changes are not going to be published by this class, it is callers resposibility to commit/publish cahnges from snapshot into global state.

Synopsis

Declared in <folly/settings/SettingsAccessorProxy.h>

class SettingsAccessorProxy
    : public ISettingsAccessorProxy

Description

This class is mainly useful when one needs to parse folly::settings from command line or a config file.

If default project and/or aliases map are provided SettingsAccessorProxy will try to expand flag name into fully qualified folly::setting name.

Base Classes

Name

Description

ISettingsAccessorProxy

Interface for applying string‐based setting changes to a snapshot.

Type Aliases

Name

Description

SettingAliases

Maps an alias name to the fully qualified setting name it refers to.

SettingMetaMap

Maps a fully qualified setting name to its static metadata.

Member Functions

Name

Description

SettingsAccessorProxy [constructor]

Constructs a proxy that applies setting changes to the given snapshot.

~SettingsAccessorProxy [destructor] [virtual]

Destroys the proxy.

getSettingMetadata

Returns the metadata for a single flag, if it is a registered setting.

getSettingsMetadata

getSettingsMetadata overloads

hasFlag

Returns true if flag is registered folly::setting. Flag alias and name expantion works the same as toFullyQualifiedName().

isBooleanFlag

Returns true if flag is registered as bool folly::setting. Flag alias and name expantion works the same as toFullyQualifiedName(). If flag is not folly::settings, returns false.

resetToDefault [virtual]

Resets flag to default value.

setFromString [virtual]

Sets value of settingName into newValue with reason set to reason. The change will be applied to the folly::settings::Snapshot associated with SettingsAccessorProxy. This function will do setting name expantion via toFullyQualifiedName() if needed.

snapshot

Returns the snapshot associated with this proxy.

toFullyQualifiedName

Return full name of folly::setting if flag is registered as folly::setting. This method will resolve flag aliases and prepend flag with default project, if any of this applies.

Protected Member Functions

Name

Description

findSettingMeta [virtual]

Looks up the metadata entry for a fully qualified setting name.

Protected Data Members

Name

Description

aliases_

Reverse map of alternative names for settings.

project_

Default project name used to expand unqualified flag names.

settingsMeta_

Map from fully qualified setting name to its metadata.

Created with MrDocs