libzypp 9.41.1

Product.h

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------\
00002 |                          ____ _   __ __ ___                          |
00003 |                         |__  / \ / / . \ . \                         |
00004 |                           / / \ V /|  _/  _/                         |
00005 |                          / /__ | | | | | |                           |
00006 |                         /_____||_| |_| |_|                           |
00007 |                                                                      |
00008 \---------------------------------------------------------------------*/
00012 #ifndef ZYPP_PRODUCT_H
00013 #define ZYPP_PRODUCT_H
00014 
00015 #include <list>
00016 #include <string>
00017 
00018 #include "zypp/ResObject.h"
00019 
00021 namespace zypp
00022 { 
00023 
00024   DEFINE_PTR_TYPE(Product);
00025 
00027   //
00028   //    CLASS NAME : Product
00029   //
00032   class Product : public ResObject
00033   {
00034   public:
00035     typedef Product                  Self;
00036     typedef ResTraits<Self>          TraitsType;
00037     typedef TraitsType::PtrType      Ptr;
00038     typedef TraitsType::constPtrType constPtr;
00039 
00040   public:
00044     sat::Solvable referencePackage() const;
00045 
00049     std::string referenceFilename() const;
00050 
00069     CapabilitySet droplist() const;
00070 
00071   public:
00072     /***/
00073     typedef std::vector<constPtr> ReplacedProducts;
00074 
00078     ReplacedProducts replacedProducts() const;
00079 
00081     std::string productLine() const;
00082 
00083   public:
00085     std::string shortName() const;
00086 
00088     std::string flavor() const;
00089 
00097     std::string type() const ZYPP_DEPRECATED;
00098 
00100     std::list<std::string> flags() const;
00101 
00103     Date endOfLife() const;
00104 
00105   public:
00109     bool isTargetDistribution() const;
00110 
00114     std::string registerTarget() const;
00115 
00119     std::string registerRelease() const;
00120 
00121   public:
00122     /***/
00123     class UrlList;
00124 
00131     UrlList urls( const std::string & key_r ) const;
00132 
00134     UrlList releaseNotesUrls() const;
00135 
00137     UrlList registerUrls() const;
00138 
00140     UrlList smoltUrls() const;
00141 
00146     UrlList updateUrls() const;
00147 
00152     UrlList extraUrls() const;
00153 
00159     UrlList optionalUrls() const;
00160 
00161   protected:
00162     friend Ptr make<Self>( const sat::Solvable & solvable_r );
00164     Product( const sat::Solvable & solvable_r );
00166     virtual ~Product();
00167   };
00168 
00173   class Product::UrlList
00174   {
00175     private:
00177       typedef std::list<Url> ListType;
00178 
00179     public:
00180       typedef ListType::value_type     value_type;
00181       typedef ListType::size_type      size_type;
00182       typedef ListType::const_iterator const_iterator;
00183 
00184       bool empty() const
00185       { return _list.empty(); }
00186 
00187       size_type size() const
00188       { return _list.size(); }
00189 
00190       const_iterator begin() const
00191       { return _list.begin(); }
00192 
00193       const_iterator end() const
00194       { return _list.end(); }
00195 
00197       Url first() const
00198       { return empty() ? value_type() : _list.front(); }
00199 
00200     public:
00202       std::string key() const
00203       { return _key; }
00204 
00205     private:
00206       friend class Product;
00208       std::string _key;
00209       ListType    _list;
00210   };
00211 
00213   std::ostream & operator<<( std::ostream & str, const Product::UrlList & obj );
00214 
00216 } // namespace zypp
00218 #endif // ZYPP_PRODUCT_H