proxygen
|
#include <Settings.h>
Public Member Functions | |
std::conditional_t< IsSmallPOD< T >::value, T, const T & > | operator* () const |
const T * | operator-> () const |
void | set (const T &t, StringPiece reason="api") |
const T & | defaultValue () const |
SettingWrapper (SettingCore< T > &core) | |
Private Attributes | |
SettingCore< T > & | core_ |
Friends | |
class | folly::settings::Snapshot |
TrivialPtr | location of the small type storage. Optimization for better inlining. |
Definition at line 36 of file Settings.h.
|
inlineexplicit |
Definition at line 76 of file Settings.h.
|
inline |
Returns the default value this setting was constructed with. NOTE: SettingsMetadata is type-agnostic, so it only stores the string representation of the default value. This method returns the actual value that was passed on construction.
Definition at line 72 of file Settings.h.
References folly::settings::detail::SettingWrapper< T, TrivialPtr >::core_.
|
inline |
Returns the setting's current value.
As an optimization, returns by value for small types, and by const& for larger types. Note that the returned reference is not guaranteed to be long-lived and should not be saved anywhere. In particular, a set() call might invalidate a reference obtained here after some amount of time (on the order of minutes).
Definition at line 47 of file Settings.h.
References folly::settings::detail::SettingWrapper< T, TrivialPtr >::core_.
Referenced by folly::settings::detail::SnapshotSettingWrapper< T >::operator->().
|
inline |
Definition at line 50 of file Settings.h.
References folly::settings::detail::SettingWrapper< T, TrivialPtr >::core_.
|
inline |
Atomically updates the setting's current value. Will invalidate any previous calls to operator*() after some amount of time (on the order of minutes).
reason | Will be stored with the current value, useful for debugging. |
std::runtime_error | If we can't convert t to string. |
Definition at line 62 of file Settings.h.
References folly::settings::detail::SettingWrapper< T, TrivialPtr >::core_.
|
friend |
Definition at line 80 of file Settings.h.
|
private |
Definition at line 79 of file Settings.h.
Referenced by folly::settings::detail::SettingWrapper< T, TrivialPtr >::defaultValue(), folly::settings::detail::SettingWrapper< T, TrivialPtr >::operator*(), folly::settings::detail::SnapshotSettingWrapper< T >::operator*(), folly::settings::detail::SettingWrapper< T, TrivialPtr >::operator->(), folly::settings::detail::SettingWrapper< T, TrivialPtr >::set(), and folly::settings::detail::SnapshotSettingWrapper< T >::set().