- Create the cache directly from the schema (installed) file.
[platform/upstream/libzypp.git] / zypp / Dependencies.h
1 /*---------------------------------------------------------------------\
2 |                          ____ _   __ __ ___                          |
3 |                         |__  / \ / / . \ . \                         |
4 |                           / / \ V /|  _/  _/                         |
5 |                          / /__ | | | | | |                           |
6 |                         /_____||_| |_| |_|                           |
7 |                                                                      |
8 \---------------------------------------------------------------------*/
9 /** \file       zypp/Dependencies.h
10  *
11 */
12 #ifndef ZYPP_DEPENDENCIES_H
13 #define ZYPP_DEPENDENCIES_H
14
15 #include <iosfwd>
16 #include <map>
17
18 #include "zypp/Dep.h"
19 #include "zypp/CapSet.h"
20
21 ///////////////////////////////////////////////////////////////////
22 namespace zypp
23 { /////////////////////////////////////////////////////////////////
24
25   ///////////////////////////////////////////////////////////////////
26   //
27   //    CLASS NAME : Dependencies
28   //
29   /** Helper keeping CapSet for all kinds of dependencies.
30   */
31   struct Dependencies
32   {
33     CapSet & operator[]( Dep idx_r )
34     { return _capsets[idx_r]; }
35
36     const CapSet & operator[]( Dep idx_r ) const
37     { return const_cast<std::map<Dep,CapSet>&>(_capsets)[idx_r]; }
38
39   private:
40     std::map<Dep,CapSet> _capsets;
41   };
42   ///////////////////////////////////////////////////////////////////
43
44   /** \relates Dependencies Stream output */
45   std::ostream & operator<<( std::ostream & str, const Dependencies & obj );
46
47   /////////////////////////////////////////////////////////////////
48 } // namespace zypp
49 ///////////////////////////////////////////////////////////////////
50 #endif // ZYPP_DEPENDENCIES_H