libzypp: zypp::media::MediaPriority Class Reference

libzypp 17.38.11

zypp::media::MediaPriority Class Reference

Derive a numeric priority from Url scheme according to zypp.conf(download.media_preference). More...

`#include <zypp/media/MediaPriority.h>`

## Public Types
using | value_type = int

## Public Member Functions
| MediaPriority ()
| Default ctor.
| MediaPriority (value_type val_r)
| Copy ctor.
| MediaPriority (const std::string &scheme_r)
| Ctor from scheme string.
| MediaPriority (const Url &url_r)
| Ctor from scheme string defined by Url.
MediaPriority & | operator= (value_type rhs)
| Assign.
MediaPriority & | operator= (const std::string &scheme_r)
| Assign priority of scheme string.
MediaPriority & | operator= (const Url &url_r)
| Assign priority of scheme string defined by Url.
value_type & | get ()
| Conversion to value_type.
const value_type & | get () const
| Explicit.
| operator value_type & ()
| Implicit.
| operator const value_type & () const
| Implicit.

## Private Attributes
value_type | _val

## Detailed Description

Derive a numeric priority from Url scheme according to zypp.conf(download.media_preference).

The class is simple. Constructable and assignable from Url or scheme string. Implicit convertible into a numic value_type.

if ( MediaPriority("cd") \< MediaPriority("ftp") )
...
zypp::media::MediaPriority::MediaPriority
MediaPriority()
Default ctor.
Definition MediaPriority.h:50

Todo
  Maybe introduce a static tribool, to allow overwriting zypp.conf(download.media_preference) default.

Definition at line 43 of file MediaPriority.h.

## Member Typedef Documentation

## ◆ value_type

using zypp::media::MediaPriority::value_type = int

Definition at line 46 of file MediaPriority.h.

## Constructor & Destructor Documentation

## ◆ MediaPriority() [1/4]

zypp::media::MediaPriority::MediaPriority | ( |  | ) |
| inline

Default ctor.

Least priority `0`.

Definition at line 50 of file MediaPriority.h.

## ◆ MediaPriority() [2/4]

zypp::media::MediaPriority::MediaPriority | ( | value_type | val_r | ) |
| inline

Copy ctor.

Definition at line 55 of file MediaPriority.h.

## ◆ MediaPriority() [3/4]

zypp::media::MediaPriority::MediaPriority | ( | const std::string & | scheme_r | ) |

Ctor from scheme string.

Definition at line 94 of file MediaPriority.cc.

## ◆ MediaPriority() [4/4]

zypp::media::MediaPriority::MediaPriority | ( | const Url & | url_r | ) |

Ctor from scheme string defined by Url.

Definition at line 98 of file MediaPriority.cc.

## Member Function Documentation

## ◆ operator=() [1/3]

MediaPriority & zypp::media::MediaPriority::operator= | ( | value_type | rhs | ) |
| inline

Assign.

Definition at line 67 of file MediaPriority.h.

## ◆ operator=() [2/3]

MediaPriority & zypp::media::MediaPriority::operator= | ( | const std::string & | scheme_r | ) |
| inline

Assign priority of scheme string.

Definition at line 71 of file MediaPriority.h.

## ◆ operator=() [3/3]

MediaPriority & zypp::media::MediaPriority::operator= | ( | const Url & | url_r | ) |
| inline

Assign priority of scheme string defined by Url.

Definition at line 75 of file MediaPriority.h.

## ◆ get() [1/2]

value_type & zypp::media::MediaPriority::get | ( |  | ) |
| inline

Conversion to value_type.

Explicit

Definition at line 82 of file MediaPriority.h.

## ◆ get() [2/2]

const value_type & zypp::media::MediaPriority::get | ( |  | ) | const
| inline

Explicit.

Definition at line 84 of file MediaPriority.h.

## ◆ operator value_type &()

zypp::media::MediaPriority::operator value_type & | ( |  | ) |
| inline

Implicit.

Definition at line 86 of file MediaPriority.h.

## ◆ operator const value_type &()

zypp::media::MediaPriority::operator const value_type & | ( |  | ) | const
| inline

Implicit.

Definition at line 88 of file MediaPriority.h.

## Member Data Documentation

## ◆ _val

value_type zypp::media::MediaPriority::_val
| private

Definition at line 92 of file MediaPriority.h.

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

- zypp/media/MediaPriority.h
- zypp/media/MediaPriority.cc