libzypp  17.5.1
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

typedef Tp value_type
 
typedef Option< Tp > option_type
 
- Public Types inherited from zypp::Option< Tp >
typedef Tp value_type
 

Public Member Functions

 DefaultOption (const value_type &initial_r)
 
void restoreToDefault ()
 Reset value to the current default. More...
 
void restoreToDefault (const value_type &newval_r)
 Reset value to a new default. More...
 
const value_typegetDefault () const
 Get the current default value. More...
 
void setDefault (const value_type &newval_r)
 Set a new default value. More...
 
- Public Member Functions inherited from zypp::Option< Tp >
 Option (const value_type &initial_r)
 No default ctor, explicit initialisation! More...
 
const value_typeget () const
 Get the value. More...
 
 operator const value_type & () const
 Autoconversion to value_type. More...
 
void set (const value_type &newval_r)
 Set a new value. More...
 
value_typeref ()
 Non-const reference to set a new value. More...
 

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 265 of file ZConfig.cc.

Member Typedef Documentation

◆ value_type

template<class Tp>
typedef Tp zypp::DefaultOption< Tp >::value_type

Definition at line 267 of file ZConfig.cc.

◆ option_type

template<class Tp>
typedef Option<Tp> zypp::DefaultOption< Tp >::option_type

Definition at line 268 of file ZConfig.cc.

Constructor & Destructor Documentation

◆ DefaultOption()

template<class Tp>
zypp::DefaultOption< Tp >::DefaultOption ( const value_type initial_r)
inline

Definition at line 270 of file ZConfig.cc.

Member Function Documentation

◆ restoreToDefault() [1/2]

template<class Tp>
void zypp::DefaultOption< Tp >::restoreToDefault ( )
inline

Reset value to the current default.

Definition at line 275 of file ZConfig.cc.

◆ restoreToDefault() [2/2]

template<class Tp>
void zypp::DefaultOption< Tp >::restoreToDefault ( const value_type newval_r)
inline

Reset value to a new default.

Definition at line 279 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 283 of file ZConfig.cc.

◆ setDefault()

template<class Tp>
void zypp::DefaultOption< Tp >::setDefault ( const value_type newval_r)
inline

Set a new default value.

Definition at line 287 of file ZConfig.cc.

Member Data Documentation

◆ _default

template<class Tp>
option_type zypp::DefaultOption< Tp >::_default
private

Definition at line 291 of file ZConfig.cc.


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