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/CapAndItem.h" 00021 #include "zypp/Dep.h" 00022 00024 namespace zypp 00025 { 00026 00027 namespace pool 00028 { 00029 00030 class PoolImpl; 00031 00033 struct PoolImplInserter 00034 { 00035 void operator()( ResObject::constPtr ptr_r ); 00036 00037 PoolImplInserter( PoolImpl & poolImpl_r, bool installed_r ) 00038 : _poolImpl( poolImpl_r ) 00039 , _installed( installed_r ) 00040 {} 00041 PoolImpl & _poolImpl; 00042 bool _installed; 00043 }; 00044 00046 struct PoolImplDeleter 00047 { 00048 void operator()( ResObject::constPtr ptr_r ); 00049 00050 PoolImplDeleter( PoolImpl & poolImpl_r ) 00051 : _poolImpl( poolImpl_r ) 00052 {} 00053 PoolImpl & _poolImpl; 00054 }; 00055 00057 // 00058 // CLASS NAME : PoolTraits 00059 // 00061 struct PoolTraits 00062 { 00063 public: 00065 typedef PoolItem Item; 00066 00068 typedef std::set<Item> ItemContainerT; 00069 typedef ItemContainerT::iterator iterator; 00070 typedef ItemContainerT::const_iterator const_iterator; 00071 typedef ItemContainerT::size_type size_type; 00072 00073 // internal organization 00074 typedef std::map<std::string,ItemContainerT> NameItemContainerT; 00076 typedef ItemContainerT::const_iterator byName_iterator; 00077 00078 // internal organization 00079 typedef std::list<CapAndItem> CapItemContainerT; // (why,who) pairs 00080 typedef std::map<std::string,CapItemContainerT> CapItemStoreT; // capability.index -> (why,who) pairs 00081 typedef std::map<Dep,CapItemStoreT> DepCapItemContainerT; // Dep -> (capability.index -> (why,who) pairs) 00082 00083 typedef CapItemContainerT::iterator capitemiterator; 00084 typedef CapItemContainerT::const_iterator const_capitemiterator; 00085 typedef CapItemContainerT::size_type capitemsize_type; 00087 typedef const_capitemiterator byCapabilityIndex_iterator; 00088 00089 typedef PoolImpl Impl; 00090 typedef shared_ptr<PoolImpl> Impl_Ptr; 00091 typedef shared_ptr<const PoolImpl> Impl_constPtr; 00092 typedef PoolImplInserter Inserter; 00093 typedef PoolImplDeleter Deleter; 00094 }; 00096 00098 } // namespace pool 00101 } // namespace zypp 00103 #endif // ZYPP_POOL_POOLTRAITS_H