libzypp  13.10.6
Product.h
Go to the documentation of this file.
1 /*---------------------------------------------------------------------\
2 | ____ _ __ __ ___ |
3 | |__ / \ / / . \ . \ |
4 | / / \ V /| _/ _/ |
5 | / /__ | | | | | | |
6 | /_____||_| |_| |_| |
7 | |
8 \---------------------------------------------------------------------*/
12 #ifndef ZYPP_PRODUCT_H
13 #define ZYPP_PRODUCT_H
14 
15 #include <list>
16 #include <string>
17 
18 #include "zypp/ResObject.h"
19 
21 namespace zypp
22 {
23 
24  DEFINE_PTR_TYPE(Product);
25 
27  //
28  // CLASS NAME : Product
29  //
32  class Product : public ResObject
33  {
34  public:
35  typedef Product Self;
39 
40  public:
45 
49  std::string referenceFilename() const;
50 
69  CapabilitySet droplist() const;
70 
71  public:
72  /***/
73  typedef std::vector<constPtr> ReplacedProducts;
74 
79 
81  std::string productLine() const;
82 
83  public:
85  std::string shortName() const;
86 
88  std::string flavor() const;
89 
95  std::string type() const;
96 
98  std::list<std::string> flags() const;
99 
100  public:
104  bool isTargetDistribution() const;
105 
109  std::string registerTarget() const;
110 
114  std::string registerRelease() const;
115 
116  public:
117  /***/
118  class UrlList;
119 
126  UrlList urls( const std::string & key_r ) const;
127 
129  UrlList releaseNotesUrls() const;
130 
132  UrlList registerUrls() const;
133 
135  UrlList smoltUrls() const;
136 
141  UrlList updateUrls() const;
142 
147  UrlList extraUrls() const;
148 
154  UrlList optionalUrls() const;
155 
156  protected:
157  friend Ptr make<Self>( const sat::Solvable & solvable_r );
159  Product( const sat::Solvable & solvable_r );
161  virtual ~Product();
162  };
163 
169  {
170  private:
172  typedef std::list<Url> ListType;
173 
174  public:
175  typedef ListType::value_type value_type;
177  typedef ListType::const_iterator const_iterator;
178 
179  bool empty() const
180  { return _list.empty(); }
181 
182  size_type size() const
183  { return _list.size(); }
184 
186  { return _list.begin(); }
187 
189  { return _list.end(); }
190 
192  Url first() const
193  { return empty() ? value_type() : _list.front(); }
194 
195  public:
197  std::string key() const
198  { return _key; }
199 
200  private:
201  friend class Product;
203  std::string _key;
205  };
206 
208  std::ostream & operator<<( std::ostream & str, const Product::UrlList & obj );
209 
211 } // namespace zypp
213 #endif // ZYPP_PRODUCT_H
Product(const sat::Solvable &solvable_r)
Ctor.
Definition: Product.cc:63
std::list< Url > ListType
Definition: Product.h:172
Product interface.
Definition: Product.h:32
const_iterator end() const
Definition: Product.h:188
A Solvable object within the sat Pool.
Definition: Solvable.h:55
size_type size() const
Definition: Product.h:182
UrlList releaseNotesUrls() const
The URL to download the release notes for this product.
Definition: Product.cc:239
bool empty() const
Definition: Product.h:179
Helper to iterate a products URL lists.
Definition: Product.h:168
std::string key() const
The key used to retrieve this list (for debug)
Definition: Product.h:197
Product Self
Definition: Product.h:35
UrlList registerUrls() const
The URL for registration.
Definition: Product.cc:240
UrlList optionalUrls() const
Optional software for the product.
Definition: Product.cc:244
const_iterator begin() const
Definition: Product.h:185
ListType::size_type size_type
Definition: Product.h:176
UrlList extraUrls() const
Additional software for the product They are complementary, not alternatives.
Definition: Product.cc:243
ResTraits.
Definition: ResTraits.h:77
TraitsType::constPtrType constPtr
Definition: Product.h:38
std::string registerRelease() const
This is register.release attribute of an installed product.
Definition: Product.cc:206
std::tr1::unordered_set< Capability > CapabilitySet
Definition: Capability.h:33
ListType::value_type value_type
Definition: Product.h:175
Url first() const
The first Url or an empty Url.
Definition: Product.h:192
DEFINE_PTR_TYPE(KeyRing)
std::ostream & operator<<(std::ostream &str, const Exception &obj)
Definition: Exception.cc:120
std::string flavor() const
The product flavor (LiveCD Demo, FTP edition,...).
Definition: Product.cc:161
ListType::const_iterator const_iterator
Definition: Product.h:177
sat::Solvable referencePackage() const
The reference package providing the product metadata, if such a package exists.
Definition: Product.cc:77
Interface base for resolvable objects (common data).
Definition: ResObject.h:44
std::string type() const
Get the product type Well, in an ideal world there is only one base product.
Definition: Product.cc:190
UrlList updateUrls() const
Online updates for the product.
Definition: Product.cc:242
ReplacedProducts replacedProducts() const
Array of installed Products that would be replaced by installing this one.
Definition: Product.cc:124
SolvableIdType size_type
Definition: PoolMember.h:99
std::vector< constPtr > ReplacedProducts
Definition: Product.h:73
std::string shortName() const
Untranslated short name like SLES 10
Definition: Product.cc:158
CapabilitySet droplist() const
List of packages included in older versions of this product and now dropped.
Definition: Product.cc:150
bool isTargetDistribution() const
This is the installed product that is also targeted by the /etc/products.d/baseproduct symlink...
Definition: Product.cc:200
std::string productLine() const
Vendor specific string denoting the product line.
Definition: Product.cc:153
std::string _key
Change to directly iterate the .solv.
Definition: Product.h:203
intrusive_ptr< _Res > PtrType
Definition: ResTraits.h:80
std::string referenceFilename() const
For installed products the name of the coddesponding /etc/products.d entry.
Definition: Product.cc:121
std::list< std::string > flags() const
The product flags.
Definition: Product.cc:193
virtual ~Product()
Dtor.
Definition: Product.cc:72
std::string registerTarget() const
This is register.target attribute of an installed product.
Definition: Product.cc:203
UrlList urls(const std::string &key_r) const
Rerieve urls flagged with key_r for this product.
Definition: Product.cc:211
Url manipulation class.
Definition: Url.h:87
TraitsType::PtrType Ptr
Definition: Product.h:37
ResTraits< Self > TraitsType
Definition: Product.h:36
UrlList smoltUrls() const
The URL for SMOLT.
Definition: Product.cc:241
intrusive_ptr< const _Res > constPtrType
Definition: ResTraits.h:81