libzypp  10.5.0
MediaPriority.h
Go to the documentation of this file.
00001 /*---------------------------------------------------------------------\
00002 |                          ____ _   __ __ ___                          |
00003 |                         |__  / \ / / . \ . \                         |
00004 |                           / / \ V /|  _/  _/                         |
00005 |                          / /__ | | | | | |                           |
00006 |                         /_____||_| |_| |_|                           |
00007 |                                                                      |
00008 \---------------------------------------------------------------------*/
00012 #ifndef ZYPP_MEDIA_MEDIAPRIORITY_H
00013 #define ZYPP_MEDIA_MEDIAPRIORITY_H
00014 
00015 #include <string>
00016 
00018 namespace zypp
00019 { 
00020 
00021   class Url;
00022 
00024   namespace media
00025   { 
00026 
00028     //
00029     //  CLASS NAME : MediaPriority
00030     //
00043     class MediaPriority
00044     {
00045       public:
00046         typedef int value_type;
00047 
00048       public:
00050         MediaPriority()
00051         : _val( 0 )
00052         {}
00053 
00055         MediaPriority( value_type val_r )
00056         : _val( val_r )
00057         {}
00058 
00060         MediaPriority( const std::string & scheme_r );
00061 
00063         MediaPriority( const Url & url_r );
00064 
00065       public:
00067         MediaPriority & operator=( value_type rhs )
00068         { _val = rhs; return *this; }
00069 
00071         MediaPriority & operator=( const std::string & scheme_r )
00072         { _val = MediaPriority(scheme_r); return *this; }
00073 
00075         MediaPriority & operator=( const Url & url_r )
00076         { _val = MediaPriority(url_r); return *this; }
00077 
00078       public:
00082         value_type &       get()            { return _val; }
00084         const value_type & get() const      { return _val; }
00086         operator value_type &()             { return get(); }
00088         operator const value_type &() const { return get(); }
00090 
00091       private:
00092         value_type _val;
00093     };
00094 
00096   } // namespace media
00099 } // namespace zypp
00101 #endif // ZYPP_MEDIA_MEDIAPRIORITY_H