move IdString to namespace zypp
[platform/upstream/libzypp.git] / zypp / sat / detail / PoolMember.h
1 /*---------------------------------------------------------------------\
2 |                          ____ _   __ __ ___                          |
3 |                         |__  / \ / / . \ . \                         |
4 |                           / / \ V /|  _/  _/                         |
5 |                          / /__ | | | | | |                           |
6 |                         /_____||_| |_| |_|                           |
7 |                                                                      |
8 \---------------------------------------------------------------------*/
9 /** \file       zypp/sat/detail/PoolMember.h
10  *
11 */
12 #ifndef ZYPP_SAT_DETAIL_POOLMEMBER_H
13 #define ZYPP_SAT_DETAIL_POOLMEMBER_H
14
15 #include "zypp/base/Iterator.h"
16
17 extern "C"
18 {
19 struct _Solvable;
20 struct _Repo;
21 struct _Pool;
22 }
23
24 ///////////////////////////////////////////////////////////////////
25 namespace zypp
26 { /////////////////////////////////////////////////////////////////
27
28   class IdString;
29
30   ///////////////////////////////////////////////////////////////////
31   namespace sat
32   { /////////////////////////////////////////////////////////////////
33
34     class Capability;
35     class Capabilities;
36     class Solvable;
37     class Repo;
38     class Pool;
39
40     ///////////////////////////////////////////////////////////////////
41     namespace detail
42     { /////////////////////////////////////////////////////////////////
43
44       class PoolImpl;
45
46       ///////////////////////////////////////////////////////////////////
47       //
48       //        CLASS NAME : PoolMember
49       //
50       /** Backlink to the associated \ref PoolImpl.
51        * Simple as we currently use one global PoolImpl. If we change our
52        * minds this is where we'd store and do the \c Id to \ref PoolImpl
53        * mapping.
54        */
55       struct PoolMember
56       {
57         static PoolImpl & myPool();
58       };
59       ///////////////////////////////////////////////////////////////////
60
61       /////////////////////////////////////////////////////////////////
62     } // namespace detail
63     ///////////////////////////////////////////////////////////////////
64
65
66     ///////////////////////////////////////////////////////////////////
67     namespace detail
68     { /////////////////////////////////////////////////////////////////
69
70       /** Generic Id type. */
71       typedef int IdType;
72       static const IdType noId( 0 );
73
74       /** Internal ids satlib includes in dependencies. */
75       static const IdType solvablePrereqMarker( 16 ); // MPL check in PoolImpl.cc
76       static const IdType solvableFileMarker  ( 17 ); // MPL check in PoolImpl.cc
77       /** Test for internal ids satlib includes in dependencies. */
78       inline bool isDepMarkerId( IdType id_r )
79       { return( id_r == solvablePrereqMarker || id_r == solvableFileMarker ); }
80
81       /** Id type to connect \ref Solvable and sat-solvable.
82        * Indext into solvable array.
83       */
84       typedef unsigned SolvableIdType;
85       /** Id to denote \ref Solvable::nosolvable. */
86       static const SolvableIdType noSolvableId( 0 );
87
88       /** Id type to connect \ref Repo and sat-repo. */
89       typedef ::_Repo * RepoIdType;
90       /** Id to denote \ref Repo::nosolvable. */
91       static const RepoIdType noRepoId( 0 );
92
93       /////////////////////////////////////////////////////////////////
94     } // namespace detail
95     ///////////////////////////////////////////////////////////////////
96
97
98     ///////////////////////////////////////////////////////////////////
99     namespace detail
100     { /////////////////////////////////////////////////////////////////
101
102       class SolvableIterator;
103       class RepoIterator;
104       class ByRepo;
105
106       /////////////////////////////////////////////////////////////////
107     } // namespace detail
108     ///////////////////////////////////////////////////////////////////
109
110     /////////////////////////////////////////////////////////////////
111   } // namespace sat
112   ///////////////////////////////////////////////////////////////////
113   /////////////////////////////////////////////////////////////////
114 } // namespace zypp
115 ///////////////////////////////////////////////////////////////////
116 #endif // ZYPP_SAT_DETAIL_POOLMEMBER_H