a type-specific Option (e.g., a boolean –toggle or -m=SBuf) More...

#include <Options.h>

Inheritance diagram for Acl::TypedOption< Recipient >:
Collaboration diagram for Acl::TypedOption< Recipient >:

Public Types

enum  ValueExpectation {
  valueNone ,
  valueOptional ,
  valueRequired
}
 

Public Member Functions

 TypedOption (const char *nameThatEnables, const char *nameThatDisables=nullptr, ValueExpectation vex=valueNone)
 
void linkWith (Recipient *recipient) const
 who to tell when this option is enabled More...
 
bool configured () const override
 
bool disabled () const override
 whether disable() has been called More...
 
bool valued () const override
 
void unconfigure () const override
 clear enable(), configureWith(), or disable() effects More...
 
void enable () const override
 called after parsing onName without a value (e.g., -x or –enable-x) More...
 
void configureWith (const SBuf &rawValue) const override
 called after parsing onName and a value (e.g., -x=v or –enable-x=v) More...
 
void disable () const override
 called after parsing offName (e.g., +i or –disable-x) More...
 
void print (std::ostream &os) const override
 prints a configuration snippet (as an admin could have typed) More...
 
void print (std::ostream &os) const
 prints a configuration snippet (as an admin could have typed) More...
 

Public Attributes

const char *const onName = nullptr
 A name that must be used to explicitly enable this Option (required). More...
 
const char *const offName = nullptr
 
ValueExpectation valueExpectation = valueNone
 expect "=value" part? More...
 

Private Member Functions

void import (const SBuf &rawValue) const
 
void import (const SBuf &rawValue) const
 

Private Attributes

Recipient * recipient_ = nullptr
 parsing results storage More...
 

Detailed Description

template<class Recipient>
class Acl::TypedOption< Recipient >

Definition at line 129 of file Options.h.

Member Enumeration Documentation

◆ ValueExpectation

Enumerator
valueNone 
valueOptional 
valueRequired 

Definition at line 59 of file Options.h.

Constructor & Destructor Documentation

◆ TypedOption()

template<class Recipient >
Acl::TypedOption< Recipient >::TypedOption ( const char *  nameThatEnables,
const char *  nameThatDisables = nullptr,
ValueExpectation  vex = valueNone 
)
inlineexplicit

Definition at line 133 of file Options.h.

Member Function Documentation

◆ configured()

template<class Recipient >
bool Acl::TypedOption< Recipient >::configured ( ) const
inlineoverridevirtual

whether the admin explicitly specified this option (i.e., whether enable(), configureWith(), or disable() has been called)

Implements Acl::Option.

Definition at line 145 of file Options.h.

References Acl::TypedOption< Recipient >::recipient_.

Referenced by Acl::TypedOption< Recipient >::print().

◆ configureWith()

template<class Recipient >
void Acl::TypedOption< Recipient >::configureWith ( const SBuf rawValue) const
inlineoverridevirtual

Implements Acl::Option.

Definition at line 163 of file Options.h.

References assert, and Acl::TypedOption< Recipient >::recipient_.

◆ disable()

template<class Recipient >
void Acl::TypedOption< Recipient >::disable ( ) const
inlineoverridevirtual

Implements Acl::Option.

Definition at line 172 of file Options.h.

References assert, and Acl::TypedOption< Recipient >::recipient_.

◆ disabled()

template<class Recipient >
bool Acl::TypedOption< Recipient >::disabled ( ) const
inlineoverridevirtual

◆ enable()

template<class Recipient >
void Acl::TypedOption< Recipient >::enable ( ) const
inlineoverridevirtual

Implements Acl::Option.

Definition at line 154 of file Options.h.

References assert, and Acl::TypedOption< Recipient >::recipient_.

◆ import() [1/2]

void Acl::TypedOption< CharacterSetOptionValue >::import ( const SBuf rawValue) const
inlineprivate

Definition at line 25 of file CharacterSetOption.h.

References SBuf::c_str().

◆ import() [2/2]

void Acl::BooleanOption::import ( const SBuf rawValue) const
inlineprivate

Definition at line 192 of file Options.h.

References Acl::TypedOption< Recipient >::recipient_.

◆ linkWith()

template<class Recipient >
void Acl::TypedOption< Recipient >::linkWith ( Recipient *  recipient) const
inline

◆ print() [1/2]

void Acl::TypedOption< CharacterSetOptionValue >::print ( std::ostream &  os) const
inlinevirtual

Implements Acl::Option.

Definition at line 34 of file CharacterSetOption.h.

◆ print() [2/2]

template<class Recipient >
void Acl::TypedOption< Recipient >::print ( std::ostream &  os) const
inlineoverridevirtual

◆ unconfigure()

template<class Recipient >
void Acl::TypedOption< Recipient >::unconfigure ( ) const
inlineoverridevirtual

Implements Acl::Option.

Definition at line 149 of file Options.h.

References assert, and Acl::TypedOption< Recipient >::recipient_.

◆ valued()

template<class Recipient >
bool Acl::TypedOption< Recipient >::valued ( ) const
inlineoverridevirtual

Implements Acl::Option.

Definition at line 147 of file Options.h.

References Acl::TypedOption< Recipient >::recipient_.

Referenced by Acl::TypedOption< Recipient >::print().

Member Data Documentation

◆ offName

const char* const Acl::Option::offName = nullptr
inherited

A name that must be used to explicitly disable this Option (optional). Nil for (and only for) options that cannot be disabled().

Definition at line 92 of file Options.h.

Referenced by Acl::TypedOption< Recipient >::disabled(), and Acl::TypedOption< Recipient >::print().

◆ onName

const char* const Acl::Option::onName = nullptr
inherited

Definition at line 88 of file Options.h.

Referenced by Acl::Option::Option(), and Acl::TypedOption< Recipient >::print().

◆ recipient_

◆ valueExpectation

ValueExpectation Acl::Option::valueExpectation = valueNone
inherited

Definition at line 94 of file Options.h.


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

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors