libzypp  10.5.0
ZYppImpl.h
Go to the documentation of this file.
00001 /*---------------------------------------------------------------------\
00002 |                          ____ _   __ __ ___                          |
00003 |                         |__  / \ / / . \ . \                         |
00004 |                           / / \ V /|  _/  _/                         |
00005 |                          / /__ | | | | | |                           |
00006 |                         /_____||_| |_| |_|                           |
00007 |                                                                      |
00008 \---------------------------------------------------------------------*/
00012 #ifndef ZYPP_ZYPP_DETAIL_ZYPPIMPL_H
00013 #define ZYPP_ZYPP_DETAIL_ZYPPIMPL_H
00014 
00015 #include <iosfwd>
00016 
00017 #include "zypp/TmpPath.h"
00018 #include "zypp/Target.h"
00019 #include "zypp/Resolver.h"
00020 #include "zypp/KeyRing.h"
00021 #include "zypp/ZYppCommit.h"
00022 #include "zypp/ResTraits.h"
00023 #include "zypp/DiskUsageCounter.h"
00024 
00025 using namespace zypp::filesystem;
00026 
00028 namespace zypp
00029 { 
00030 
00031   namespace zypp_detail
00032   { 
00033 
00035     //
00036     //  CLASS NAME : ZYppImpl
00037     //
00039     class ZYppImpl
00040     {
00041       friend std::ostream & operator<<( std::ostream & str, const ZYppImpl & obj );
00042 
00043     public:
00045       ZYppImpl();
00047       ~ZYppImpl();
00048 
00049     public:
00051       ResPool pool() const
00052       { return ResPool::instance(); }
00053 
00054       ResPoolProxy poolProxy() const
00055       { return ResPool::instance().proxy(); }
00056 
00058       KeyRing_Ptr keyRing() const
00059       { return _keyring; }
00060 
00061 
00062       Resolver_Ptr resolver() const
00063       { return _resolver; }
00064 
00065     public:
00070       Target_Ptr target() const;
00071 
00075       Target_Ptr getTarget() const
00076       { return _target; }
00077 
00082       void initializeTarget( const Pathname & root, bool doRebuild_r );
00083 
00087       void finishTarget();
00088 
00090       ZYppCommitResult commit( const ZYppCommitPolicy & policy_r );
00091 
00093       void installSrcPackage( const SrcPackage_constPtr & srcPackage_r );
00094 
00095     public:
00097       Pathname homePath() const;
00098 
00100       Pathname tmpPath() const;
00101 
00103       void setHomePath( const Pathname & path );
00104 
00105     public:
00106       DiskUsageCounter::MountPointSet diskUsage();
00107       void setPartitions(const DiskUsageCounter::MountPointSet &mp);
00108       DiskUsageCounter::MountPointSet getPartitions() const;
00109 
00110     private:
00112       Target_Ptr _target;
00114       Resolver_Ptr _resolver;
00115 
00116       KeyRing_Ptr _keyring;
00118       Pathname _home_path;
00120       shared_ptr<DiskUsageCounter> _disk_usage;
00121     };
00123 
00125     std::ostream & operator<<( std::ostream & str, const ZYppImpl & obj );
00126 
00128   } // namespace zypp_detail
00131 } // namespace zypp
00133 #endif // ZYPP_ZYPP_DETAIL_ZYPPIMPL_H