libzypp: zypp::DefaultOption< Tp > Struct Template Reference

libzypp 17.38.6

zypp::DefaultOption< Tp > Struct Template Reference

Mutable option with initial value also remembering a config value. More...

Inheritance diagram for zypp::DefaultOption< Tp >:

## Public Types
using | value_type = Tp
using | option_type = Option<Tp>
Public Types inherited from zypp::Option< Tp >
using | value_type = Tp

## Public Member Functions
| DefaultOption (value_type initial_r)
DefaultOption & | operator= (value_type newval_r)
void | restoreToDefault ()
| Reset value to the current default.
void | restoreToDefault (value_type newval_r)
| Reset value to a new default.
const value_type & | getDefault () const
| Get the current default value.
void | setDefault (value_type newval_r)
| Set a new default value.
Public Member Functions inherited from zypp::Option< Tp >
| Option (value_type initial_r)
| No default ctor, explicit initialisation!
Option & | operator= (value_type newval_r)
const value_type & | get () const
| Get the value.
| operator const value_type & () const
| Autoconversion to value_type.
void | set (value_type newval_r)
| Set a new value.

## Private Attributes
option_type | _default

## Detailed Description

template<class Tp>
struct zypp::DefaultOption< Tp >

Mutable option with initial value also remembering a config value.

Definition at line 191 of file ZConfig.cc.

## Member Typedef Documentation

## ◆ value_type

template<class Tp>

using zypp::DefaultOption< Tp >::value_type = Tp

Definition at line 193 of file ZConfig.cc.

## ◆ option_type

template<class Tp>

using zypp::DefaultOption< Tp >::option_type = Option<Tp>

Definition at line 194 of file ZConfig.cc.

## Constructor & Destructor Documentation

## ◆ DefaultOption()

template<class Tp>

zypp::DefaultOption< Tp >::DefaultOption | ( | value_type | initial_r | ) |
| inlineexplicit

Definition at line 196 of file ZConfig.cc.

## Member Function Documentation

## ◆ operator=()

template<class Tp>

DefaultOption & zypp::DefaultOption< Tp >::operator= | ( | value_type | newval_r | ) |
| inline

Definition at line 201 of file ZConfig.cc.

## ◆ restoreToDefault() [1/2]

template<class Tp>

void zypp::DefaultOption< Tp >::restoreToDefault | ( |  | ) |
| inline

Reset value to the current default.

Definition at line 205 of file ZConfig.cc.

## ◆ restoreToDefault() [2/2]

template<class Tp>

void zypp::DefaultOption< Tp >::restoreToDefault | ( | value_type | newval_r | ) |
| inline

Reset value to a new default.

Definition at line 209 of file ZConfig.cc.

## ◆ getDefault()

template<class Tp>

const value_type & zypp::DefaultOption< Tp >::getDefault | ( |  | ) | const
| inline

Get the current default value.

Definition at line 213 of file ZConfig.cc.

## ◆ setDefault()

template<class Tp>

void zypp::DefaultOption< Tp >::setDefault | ( | value_type | newval_r | ) |
| inline

Set a new default value.

Definition at line 217 of file ZConfig.cc.

## Member Data Documentation

## ◆ _default

template<class Tp>

option_type zypp::DefaultOption< Tp >::_default
| private

Definition at line 221 of file ZConfig.cc.

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

- zypp/ZConfig.cc