PoolTraits.h

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------\
00002 |                          ____ _   __ __ ___                          |
00003 |                         |__  / \ / / . \ . \                         |
00004 |                           / / \ V /|  _/  _/                         |
00005 |                          / /__ | | | | | |                           |
00006 |                         /_____||_| |_| |_|                           |
00007 |                                                                      |
00008 \---------------------------------------------------------------------*/
00012 #ifndef ZYPP_POOL_POOLTRAITS_H
00013 #define ZYPP_POOL_POOLTRAITS_H
00014 
00015 #include <set>
00016 #include <map>
00017 
00018 #include "zypp/PoolItem.h"
00019 #include "zypp/Capability.h"
00020 #include "zypp/Dep.h"
00021 #include "zypp/ResStatus.h"
00022 
00024 namespace zypp
00025 { 
00026 
00027   class CapAndItem;
00028   class Repository;
00029 
00031   namespace pool
00032   { 
00033 
00034     class PoolImpl;
00035 
00037     struct PoolImplInserter
00038     {
00039       void operator()( ResObject::constPtr ptr_r );
00040 
00041       PoolImplInserter( PoolImpl & poolImpl_r, bool installed_r )
00042       : _poolImpl( poolImpl_r )
00043       , _installed( installed_r )
00044       {}
00045       PoolImpl & _poolImpl;
00046       bool       _installed;
00047     };
00048 
00050     struct PoolImplDeleter
00051     {
00052       void operator()( ResObject::constPtr ptr_r );
00053 
00054       PoolImplDeleter( PoolImpl & poolImpl_r )
00055       : _poolImpl( poolImpl_r )
00056       {}
00057       PoolImpl & _poolImpl;
00058     };
00059 
00061     //
00062     //  CLASS NAME : PoolTraits
00063     //
00065     struct PoolTraits
00066     {
00067     public:
00069       typedef PoolItem                          Item;
00070 
00072       typedef std::set<Item>                            ItemContainerT;
00073       typedef ItemContainerT::iterator                  iterator;
00074       typedef ItemContainerT::const_iterator            const_iterator;
00075       typedef ItemContainerT::size_type                 size_type;
00076 
00077       // internal organization
00078       typedef std::map<std::string,ItemContainerT>      NameItemContainerT;
00080       typedef ItemContainerT::const_iterator            byName_iterator;
00081 
00082       // internal organization
00083       typedef std::list<zypp::CapAndItem>               CapItemContainerT;      // (why,who) pairs
00084       typedef std::map<std::string,CapItemContainerT>   CapItemStoreT;          // capability.index -> (why,who) pairs
00085       typedef std::map<Dep,CapItemStoreT>               DepCapItemContainerT;   // Dep -> (capability.index -> (why,who) pairs)
00086 
00087       typedef CapItemContainerT::iterator               capitemiterator;
00088       typedef CapItemContainerT::const_iterator         const_capitemiterator;
00089       typedef CapItemContainerT::size_type              capitemsize_type;
00091       typedef const_capitemiterator                     byCapabilityIndex_iterator;
00092 
00093       /* list of known Repositories */
00094       typedef std::set<Repository>                      RepoContainerT;
00095       typedef RepoContainerT::const_iterator            repository_iterator;
00096 
00097       typedef PoolImpl                   Impl;
00098       typedef shared_ptr<PoolImpl>       Impl_Ptr;
00099       typedef shared_ptr<const PoolImpl> Impl_constPtr;
00100       typedef PoolImplInserter           Inserter;
00101       typedef PoolImplDeleter            Deleter;
00102 
00104       typedef std::map<ResStatus::TransactByValue,CapSet>               AdditionalCapSet;
00105 
00106     };
00108 
00110   } // namespace pool
00113 } // namespace zypp
00115 #endif // ZYPP_POOL_POOLTRAITS_H

Generated on Tue Sep 25 19:23:05 2007 for libzypp by  doxygen 1.5.3