libzypp: zypp/media/MediaPriority.h Source File

libzypp 17.38.6

MediaPriority.h
Go to the documentation of this file.
1/*---------------------------------------------------------------------\
2| ____ _ __ __ ___ |
3| |__ / \ / / . \ . \ |
4| / / \ V /| _/ _/ |
5| / /__ | | | | | | |
6| /_____||_| |_| |_| |
7| |
8\---------------------------------------------------------------------*/
12#ifndef ZYPP_MEDIA_MEDIAPRIORITY_H
13#define ZYPP_MEDIA_MEDIAPRIORITY_H
14
15#include <string>
16
18namespace zypp
19{
20
21 class Url;
22
24 namespace media
25 {
26
28 //
29 // CLASS NAME : MediaPriority
30 //
43 class MediaPriority
44 {
45 public:
46 using value_type = int;
47
48 public:
50 MediaPriority()
51 : _val( 0 )
52 {}
53
55 MediaPriority( value_type val_r )
56 : _val( val_r )
57 {}
58
60 MediaPriority( const std::string & scheme_r );
61
63 MediaPriority( const Url & url_r );
64
65 public:
67 MediaPriority & operator=( value_type rhs )
68 { _val = rhs; return *this; }
69
71 MediaPriority & operator=( const std::string & scheme_r )
72 { _val = MediaPriority(scheme_r); return *this; }
73
75 MediaPriority & operator=( const Url & url_r )
76 { _val = MediaPriority(url_r); return *this; }
77
78 public:
81
82 value_type & get() { return _val; }
84 const value_type & get() const { return _val; }
86 operator value_type &() { return get(); }
88 operator const value_type &() const { return get(); }
90
91 private:
92 value_type _val;
93 };
94
96 } // namespace media
99} // namespace zypp
101#endif // ZYPP_MEDIA_MEDIAPRIORITY_H
zypp::Url
Url manipulation class.
Definition Url.h:93
zypp::media::MediaPriority::get
value_type & get()
Conversion to value_type.
Definition MediaPriority.h:82
zypp::media::MediaPriority::operator=
MediaPriority & operator=(const std::string &scheme_r)
Assign priority of scheme string.
Definition MediaPriority.h:71
zypp::media::MediaPriority::operator=
MediaPriority & operator=(value_type rhs)
Assign.
Definition MediaPriority.h:67
zypp::media::MediaPriority::operator=
MediaPriority & operator=(const Url &url_r)
Assign priority of scheme string defined by Url.
Definition MediaPriority.h:75
zypp::media::MediaPriority::MediaPriority
MediaPriority(value_type val_r)
Copy ctor.
Definition MediaPriority.h:55
zypp::media::MediaPriority::value_type
int value_type
Definition MediaPriority.h:46
zypp::media::MediaPriority::MediaPriority
MediaPriority()
Default ctor.
Definition MediaPriority.h:50
zypp::media::MediaPriority::_val
value_type _val
Definition MediaPriority.h:92
zypp::media::MediaPriority::get
const value_type & get() const
Explicit.
Definition MediaPriority.h:84
zypp::media
Definition MediaNetworkRequestExecutor.h:22
zypp
Easy-to use interface to the ZYPP dependency resolver.
Definition CodePitfalls.doc:2