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