#include <YesNoNone.h>

Collaboration diagram for YesNoNone:

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 27 of file YesNoNone.h.

Member Enumeration Documentation

enum YesNoNone::SetHow : uint8_t
private
Enumerator
optUnspecified 
optImplicitly 
optConfigured 

Definition at line 29 of file YesNoNone.h.

Constructor & Destructor Documentation

YesNoNone::YesNoNone ( )
inline

Definition at line 33 of file YesNoNone.h.

YesNoNone::YesNoNone ( bool  beSet)
inlineexplicit

Definition at line 39 of file YesNoNone.h.

Member Function Documentation

void YesNoNone::configure ( bool  beSet)
inline

Definition at line 52 of file YesNoNone.h.

References optConfigured, option, and setHow_.

Referenced by MemStoreRr::finalizeConfig(), parse_YesNoNone(), and testYesNoNone::testBasics().

bool YesNoNone::configured ( ) const
inline

whether the option was enabled or disabled, by squid.conf values resulting in explicit configure() usage.

Definition at line 66 of file YesNoNone.h.

References optConfigured, and setHow_.

Referenced by dump_YesNoNone(), MemStoreRr::finalizeConfig(), testYesNoNone::testBasics(), TransientsRr::useConfig(), and MemStoreRr::useConfig().

void YesNoNone::defaultTo ( bool  beSet)
inline
YesNoNone::operator bool ( ) const
inlineexplicit

the boolean equivalent of the value stored. asserts if the value has not been set.

Definition at line 46 of file YesNoNone.h.

References Must, option, optUnspecified, and setHow_.

Member Data Documentation

bool YesNoNone::option
private

Definition at line 70 of file YesNoNone.h.

Referenced by configure(), defaultTo(), and operator bool().

SetHow YesNoNone::setHow_
private

Definition at line 69 of file YesNoNone.h.

Referenced by configure(), configured(), defaultTo(), and operator bool().


The documentation for this class was generated from the following file:

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors