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

Member Enumeration Documentation

◆ SetHow

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

Definition at line 30 of file YesNoNone.h.

Constructor & Destructor Documentation

◆ YesNoNone() [1/2]

YesNoNone::YesNoNone ( )
inline

Definition at line 34 of file YesNoNone.h.

◆ YesNoNone() [2/2]

YesNoNone::YesNoNone ( bool  beSet)
inlineexplicit

Definition at line 40 of file YesNoNone.h.

Member Function Documentation

◆ configure()

void YesNoNone::configure ( bool  beSet)
inline

Definition at line 53 of file YesNoNone.h.

References optConfigured, option, and setHow_.

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

◆ configured()

bool YesNoNone::configured ( ) const
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()

void YesNoNone::defaultTo ( bool  beSet)
inline

◆ operator bool()

YesNoNone::operator bool ( ) const
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

bool YesNoNone::option
private

Definition at line 71 of file YesNoNone.h.

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

◆ setHow_

SetHow YesNoNone::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:

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors