SourceFeed.cc

Go to the documentation of this file.
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 
00018 using std::endl;
00019 
00021 namespace zypp
00022 { 
00023 
00025   //
00026   //    CLASS NAME : SourceFeed_Ref::Impl
00027   //
00029   struct SourceFeed_Ref::Impl
00030   {
00031 
00032 
00033     Impl(  ResPoolManager pool_r )
00034     : _pool( pool_r )
00035     {}
00036 
00037 #if 0
00038     void addSource( Source_Ref src_r );
00039     void removeSource( Source_Ref src_r );
00040 #endif
00041 
00042     const_iterator sourceBegin() const
00043     { return _sources.begin(); }
00044 
00045     const_iterator sourceEnd() const
00046     { return _sources.end(); }
00047 
00048     void insert( ContainerT & sources_r )
00049     {
00050       for ( const_iterator it = sources_r.begin(); it != sources_r.end(); ++it )
00051         {
00052           _sources.insert( *it );
00053           _pool.insert( it->resolvables().begin(), it->resolvables().end() );
00054         }
00055     }
00056 
00057     void erase( ContainerT & sources_r )
00058     {
00059       for ( const_iterator it = sources_r.begin(); it != sources_r.end(); ++it )
00060         {
00061           //_pool.erase( it->resolvables().begin(), it->resolvables().end() );
00062           _sources.erase( *it );
00063         }
00064     }
00065 
00067     ResPoolManager _pool;
00068 
00069     ContainerT _sources;
00070   };
00072 
00074   inline std::ostream & operator<<( std::ostream & str, const SourceFeed_Ref::Impl & obj )
00075   {
00076     return str << "SourceFeed::Impl";
00077   }
00078 
00080   //
00081   //    CLASS NAME : SourceFeed_Ref
00082   //
00084 
00086   //
00087   //    METHOD NAME : SourceFeed_Ref::SourceFeed_Ref
00088   //    METHOD TYPE : Ctor
00089   //
00090   SourceFeed_Ref::SourceFeed_Ref( ResPoolManager pool_r )
00091   : _pimpl( new Impl( pool_r ) )
00092   {}
00093 
00095   //
00096   //    METHOD NAME : SourceFeed_Ref::~SourceFeed_Ref
00097   //    METHOD TYPE : Dtor
00098   //
00099   SourceFeed_Ref::~SourceFeed_Ref()
00100   {}
00101 
00103 #if 0
00104   void SourceFeed_Ref::addSource( Source_Ref src_r )
00105   { _pimpl->addSource( src_r ); }
00106 
00107   void SourceFeed_Ref::removeSource( Source_Ref src_r )
00108   { _pimpl->removeSource( src_r ); }
00109 
00110 #endif
00111 
00112   void SourceFeed_Ref::insert( ContainerT & sources_r )
00113   { _pimpl->insert( sources_r ); }
00114 
00115   void SourceFeed_Ref::erase( ContainerT & sources_r )
00116   { _pimpl->erase( sources_r ); }
00117 
00118   SourceFeed_Ref::const_iterator SourceFeed_Ref::sourceBegin() const
00119   { return _pimpl->sourceBegin(); }
00120 
00121   SourceFeed_Ref::const_iterator SourceFeed_Ref::sourceEnd() const
00122   { return _pimpl->sourceEnd(); }
00123 
00125 
00126   /******************************************************************
00127   **
00128   **    FUNCTION NAME : operator<<
00129   **    FUNCTION TYPE : std::ostream &
00130   */
00131   std::ostream & operator<<( std::ostream & str, const SourceFeed_Ref & obj )
00132   {
00133     return str << *obj._pimpl;
00134   }
00135 
00137 } // namespace zypp

Generated on Thu Jul 6 00:07:25 2006 for zypp by  doxygen 1.4.6