00001 /*---------------------------------------------------------------------\ 00002 | ____ _ __ __ ___ | 00003 | |__ / \ / / . \ . \ | 00004 | / / \ V /| _/ _/ | 00005 | / /__ | | | | | | | 00006 | /_____||_| |_| |_| | 00007 | | 00008 \---------------------------------------------------------------------*/ 00012 #include <iostream> 00013 //#include "zypp/base/Logger.h" 00014 00015 #include "zypp/ResPoolManager.h" 00016 #include "zypp/SourceFeed.h" 00017 #include "zypp/ResStore.h" 00018 00019 using std::endl; 00020 00022 namespace zypp 00023 { 00024 00026 // 00027 // CLASS NAME : SourceFeed_Ref::Impl 00028 // 00030 struct SourceFeed_Ref::Impl 00031 { 00032 00033 00034 Impl( ResPoolManager pool_r ) 00035 : _pool( pool_r ) 00036 {} 00037 00038 #if 0 00039 void addSource( Source_Ref src_r ); 00040 void removeSource( Source_Ref src_r ); 00041 #endif 00042 00043 const_iterator sourceBegin() const 00044 { return _sources.begin(); } 00045 00046 const_iterator sourceEnd() const 00047 { return _sources.end(); } 00048 00049 void insert( ContainerT & sources_r ) 00050 { 00051 for ( const_iterator it = sources_r.begin(); it != sources_r.end(); ++it ) 00052 { 00053 _sources.insert( *it ); 00054 _pool.insert( it->resolvables().begin(), it->resolvables().end() ); 00055 } 00056 } 00057 00058 void erase( ContainerT & sources_r ) 00059 { 00060 for ( const_iterator it = sources_r.begin(); it != sources_r.end(); ++it ) 00061 { 00062 //_pool.erase( it->resolvables().begin(), it->resolvables().end() ); 00063 _sources.erase( *it ); 00064 } 00065 } 00066 00068 ResPoolManager _pool; 00069 00070 ContainerT _sources; 00071 }; 00073 00075 inline std::ostream & operator<<( std::ostream & str, const SourceFeed_Ref::Impl & obj ) 00076 { 00077 return str << "SourceFeed::Impl"; 00078 } 00079 00081 // 00082 // CLASS NAME : SourceFeed_Ref 00083 // 00085 00087 // 00088 // METHOD NAME : SourceFeed_Ref::SourceFeed_Ref 00089 // METHOD TYPE : Ctor 00090 // 00091 SourceFeed_Ref::SourceFeed_Ref( ResPoolManager pool_r ) 00092 : _pimpl( new Impl( pool_r ) ) 00093 {} 00094 00096 // 00097 // METHOD NAME : SourceFeed_Ref::~SourceFeed_Ref 00098 // METHOD TYPE : Dtor 00099 // 00100 SourceFeed_Ref::~SourceFeed_Ref() 00101 {} 00102 00104 #if 0 00105 void SourceFeed_Ref::addSource( Source_Ref src_r ) 00106 { _pimpl->addSource( src_r ); } 00107 00108 void SourceFeed_Ref::removeSource( Source_Ref src_r ) 00109 { _pimpl->removeSource( src_r ); } 00110 00111 #endif 00112 00113 void SourceFeed_Ref::insert( ContainerT & sources_r ) 00114 { _pimpl->insert( sources_r ); } 00115 00116 void SourceFeed_Ref::erase( ContainerT & sources_r ) 00117 { _pimpl->erase( sources_r ); } 00118 00119 SourceFeed_Ref::const_iterator SourceFeed_Ref::sourceBegin() const 00120 { return _pimpl->sourceBegin(); } 00121 00122 SourceFeed_Ref::const_iterator SourceFeed_Ref::sourceEnd() const 00123 { return _pimpl->sourceEnd(); } 00124 00126 00127 /****************************************************************** 00128 ** 00129 ** FUNCTION NAME : operator<< 00130 ** FUNCTION TYPE : std::ostream & 00131 */ 00132 std::ostream & operator<<( std::ostream & str, const SourceFeed_Ref & obj ) 00133 { 00134 return str << *obj._pimpl; 00135 } 00136 00138 } // namespace zypp
1.5.0