#include <YesNoNone.h>
Public Member Functions | |
YesNoNone () | |
YesNoNone (bool beSet) | |
operator bool () const | |
void | configure (bool beSet) |
enables or disables the option; updating to 'configured' state More... | |
void | defaultTo (bool beSet) |
enables or disables the option; updating to 'implicit' state More... | |
bool | configured () const |
Private Types | |
enum | SetHow : uint8_t { optUnspecified = 0 , optImplicitly = 1 , optConfigured = 2 } |
Private Attributes | |
SetHow | setHow_ |
how the option was set More... | |
bool | option |
specified yes/no value; meaningless if optUnspecified More... | |
Detailed Description
Used for boolean enabled/disabled options with complex default logic. Allows Squid to compute the right default after configuration. Checks that not-yet-defined option values are not used. Allows for implicit default Yes/No values to be used by initialization without configure() being called, but not dumped as squid.conf content.
Use x.configure(bool) when the value is configured. Use x.defaultTo(bool) to assign defaults.
Definition at line 28 of file YesNoNone.h.
Member Enumeration Documentation
◆ SetHow
|
private |
Enumerator | |
---|---|
optUnspecified | |
optImplicitly | |
optConfigured |
Definition at line 30 of file YesNoNone.h.
Constructor & Destructor Documentation
◆ YesNoNone() [1/2]
|
inline |
Definition at line 34 of file YesNoNone.h.
◆ YesNoNone() [2/2]
|
inlineexplicit |
Definition at line 40 of file YesNoNone.h.
Member Function Documentation
◆ configure()
|
inline |
Definition at line 53 of file YesNoNone.h.
References optConfigured, option, and setHow_.
Referenced by MemStoreRr::finalizeConfig(), parse_YesNoNone(), and TestYesNoNone::testBasics().
◆ configured()
|
inline |
whether the option was enabled or disabled, by squid.conf values resulting in explicit configure() usage.
Definition at line 67 of file YesNoNone.h.
References optConfigured, and setHow_.
Referenced by dump_YesNoNone(), MemStoreRr::finalizeConfig(), TestYesNoNone::testBasics(), MemStoreRr::useConfig(), and TransientsRr::useConfig().
◆ defaultTo()
|
inline |
Definition at line 59 of file YesNoNone.h.
References Must, optConfigured, optImplicitly, option, and setHow_.
Referenced by Security::ServerOptions::ServerOptions(), commonInit(), and TestUfs::commonInit().
◆ operator bool()
|
inlineexplicit |
the boolean equivalent of the value stored. asserts if the value has not been set.
Definition at line 47 of file YesNoNone.h.
References Must, option, optUnspecified, and setHow_.
Member Data Documentation
◆ option
|
private |
Definition at line 71 of file YesNoNone.h.
Referenced by configure(), defaultTo(), and operator bool().
◆ setHow_
|
private |
Definition at line 70 of file YesNoNone.h.
Referenced by configure(), configured(), defaultTo(), and operator bool().
The documentation for this class was generated from the following file:
- src/base/YesNoNone.h