Target.h

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------\
00002 |                          ____ _   __ __ ___                          |
00003 |                         |__  / \ / / . \ . \                         |
00004 |                           / / \ V /|  _/  _/                         |
00005 |                          / /__ | | | | | |                           |
00006 |                         /_____||_| |_| |_|                           |
00007 |                                                                      |
00008 \---------------------------------------------------------------------*/
00012 #ifndef ZYPP_TARGET_H
00013 #define ZYPP_TARGET_H
00014 
00015 #include <iosfwd>
00016 
00017 #include "zypp/base/ReferenceCounted.h"
00018 #include "zypp/base/NonCopyable.h"
00019 #include "zypp/base/PtrTypes.h"
00020 #include "zypp/base/Deprecated.h"
00021 
00022 #include "zypp/ResStore.h"
00023 #include "zypp/Pathname.h"
00024 #include "zypp/ResPool.h"
00025 
00027 namespace zypp
00028 { 
00029   namespace target
00030   {
00031     class TargetImpl;
00032     namespace rpm {
00033       class RpmDb;
00034     }
00035   }
00036   namespace zypp_detail
00037   {
00038     class ZYppImpl;
00039   }
00040 
00041   DEFINE_PTR_TYPE(Target);
00042   
00044   //
00045   //    CLASS NAME : Target
00046   //
00049   class Target : public base::ReferenceCounted, public base::NonCopyable
00050   {
00051   public:
00052     typedef target::TargetImpl  Impl;
00053     typedef intrusive_ptr<Impl> Impl_Ptr;
00054     typedef std::list<PoolItem_Ref> PoolItemList;
00055 
00056   public:
00057 
00059     const ResStore & resolvables();
00060     
00068     void reset();
00069     
00075     ResStore::resfilter_const_iterator byKindBegin( const ResObject::Kind & kind_r  ) const;
00076     ResStore::resfilter_const_iterator byKindEnd( const ResObject::Kind & kind_r ) const;
00077 
00079     static Target_Ptr nullimpl();
00080 
00082     target::rpm::RpmDb & rpmDb();
00083 
00086     bool providesFile (const std::string & name_str, const std::string & path_str) const;
00087 
00088     ResObject::constPtr whoOwnsFile (const std::string & path_str) const;
00089 
00094     void getResolvablesToInsDel ( const ResPool pool_r,
00095                                   PoolItemList & dellist_r,
00096                                   PoolItemList & instlist_r,
00097                                   PoolItemList & srclist_r ) const;
00098 
00099 #ifndef STORAGE_DISABLED
00100 
00101     bool isStorageEnabled() const;
00102     void enableStorage(const Pathname &root_r);
00103 #endif
00104 
00106     bool setInstallationLogfile(const Pathname & path_r);
00107 
00109     Pathname root() const;
00110 
00112     Date timestamp() const;
00113   public:
00115     explicit
00116     Target( const Pathname & root = "/" );
00118     explicit
00119     Target( const Impl_Ptr & impl_r );
00120 
00121   private:
00122     friend std::ostream & operator<<( std::ostream & str, const Target & obj );
00124     std::ostream & dumpOn( std::ostream & str ) const;
00125 
00126   private:
00128     friend class zypp_detail::ZYppImpl;
00129 
00131     RW_pointer<Impl,rw_pointer::Intrusive<Impl> > _pimpl;
00132 
00133     static Target_Ptr _nullimpl;
00134   };
00136 
00138   inline std::ostream & operator<<( std::ostream & str, const Target & obj )
00139   { return obj.dumpOn( str ); }
00140 
00141 
00143 } // namespace zypp
00145 #endif // ZYPP_TARGET_H

Generated on Tue Nov 28 16:49:33 2006 for zypp by  doxygen 1.5.0