Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members

InstSrcData.h

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------\
00002 |                                                                      |
00003 |                      __   __    ____ _____ ____                      |
00004 |                      \ \ / /_ _/ ___|_   _|___ \                     |
00005 |                       \ V / _` \___ \ | |   __) |                    |
00006 |                        | | (_| |___) || |  / __/                     |
00007 |                        |_|\__,_|____/ |_| |_____|                    |
00008 |                                                                      |
00009 |                               core system                            |
00010 |                                                        (C) SuSE GmbH |
00011 \----------------------------------------------------------------------/
00012 
00013    File:       InstSrcData.h
00014 
00015    Author:     Michael Andres <ma@suse.de>
00016    Maintainer: Michael Andres <ma@suse.de>
00017 
00018     Purpose: Base class for all concrete InstSrcData classes.
00019 
00020 /-*/
00021 #ifndef InstSrcData_h
00022 #define InstSrcData_h
00023 
00024 #include <iosfwd>
00025 #include <list>
00026 
00027 #include <y2util/Pathname.h>
00028 
00029 #include <y2pm/InstData.h>
00030 
00031 #include <y2pm/InstSrcDataPtr.h>
00032 #include <y2pm/InstSrcError.h>
00033 
00034 #include <y2pm/InstSrc.h>
00035 #include <y2pm/InstSrcDescrPtr.h>
00036 #include <y2pm/MediaAccessPtr.h>
00037 
00038 #include <y2pm/PMPackageDataProviderPtr.h>
00039 #include <y2pm/PMSelectionDataProviderPtr.h>
00040 
00042 //
00043 //      CLASS NAME : InstSrcData
00047 class InstSrcData: public CountedRep, public InstData {
00048   REP_BODY(InstSrcData);
00049 
00050   public:
00051 
00055     typedef InstSrcError Error;
00056 
00057   private:
00058 
00062     friend class InstSrc;
00063 
00067     bool _propagating;
00068 
00072     PMError _instSrc_attach( const InstSrcPtr & instSrc_r );
00073 
00077     PMError _instSrc_detach();
00078 
00082     PMError _instSrc_propagate();
00083 
00087     PMError _instSrc_withdraw();
00088 
00089   public:
00090 
00095     InstSrcData();
00096 
00097     virtual ~InstSrcData();
00098 
00099   protected:
00100 
00104     bool attached() const { return _instSrc; }
00105 
00109     InstSrcPtr _instSrc;
00110 
00111   protected:
00112 
00116     static PMPackageDataProviderPtr   getDataProvider( const PMPackagePtr & obj_r );
00117 
00121     static PMSelectionDataProviderPtr getDataProvider( const PMSelectionPtr & obj_r );
00122 
00123   protected:
00124 
00130     virtual PMError propagateObjects();
00131 
00139     virtual PMError withdrawObjects();
00140 
00141   public:
00142 
00146     virtual PMError writeCache( const Pathname & cache_dir_r ) const;
00147 
00148   public:
00149 
00153     virtual const std::list<PMSelectionPtr> & getSelections() const { return InstData::getSelections(); }
00154 
00158     virtual const std::list<PMPackagePtr> &   getPackages()   const { return InstData::getPackages(); }
00159 
00163     virtual const std::vector<PMYouPatchPtr> &  getPatches()    const { return InstData::getPatches(); }
00164 
00168     constInstSrcPtr attachedToInstSrc() const { return _instSrc; }
00169 
00173     virtual void preferredLocaleChanged() const {}
00174 
00175   public:
00176 
00177     std::ostream & dumpOn( std::ostream & str ) const;
00178 
00179   public:
00180 
00188     static PMError tryGetDescr( InstSrcDescrPtr & ndescr_r,
00189                                 MediaAccessPtr media_r, const Pathname & produduct_dir_r );
00190 
00200     static PMError tryGetData( InstSrcDataPtr & ndata_r,
00201                                MediaAccessPtr media_r, const Pathname & descr_dir_r );
00202 };
00203 
00205 
00206 #endif // InstSrcData_h
00207 

Generated on Fri Nov 9 14:30:31 2007 for yast2-packagemanager by doxygen 1.3.6