00001 /*---------------------------------------------------------------------\ 00002 | ____ _ __ __ ___ | 00003 | |__ / \ / / . \ . \ | 00004 | / / \ V /| _/ _/ | 00005 | / /__ | | | | | | | 00006 | /_____||_| |_| |_| | 00007 | | 00008 \---------------------------------------------------------------------*/ 00012 #ifndef ZYPP_ZYPPCOMMITRESULT_H 00013 #define ZYPP_ZYPPCOMMITRESULT_H 00014 00015 #include <iosfwd> 00016 #include <vector> 00017 #include <list> 00018 00019 #include "zypp/PoolItem.h" 00020 #include "zypp/sat/Transaction.h" 00021 #include "zypp/base/DefaultIntegral.h" 00022 00024 namespace zypp 00025 { 00026 00027 namespace sat 00028 { 00029 class Transaction; 00030 } 00031 00033 class UpdateNotificationFile 00034 { 00035 public: 00036 UpdateNotificationFile( sat::Solvable solvable_r, const Pathname & file_r ) 00037 : _solvable( solvable_r ), _file( file_r ) 00038 {} 00039 public: 00040 sat::Solvable solvable() const { return _solvable; } 00041 const Pathname & file() const { return _file; } 00042 private: 00043 sat::Solvable _solvable; 00044 Pathname _file; 00045 }; 00046 00047 typedef std::list<UpdateNotificationFile> UpdateNotifications; 00048 00050 // 00051 // CLASS NAME : ZYppCommitResult 00052 // 00062 class ZYppCommitResult 00063 { 00064 public: 00065 typedef std::vector<sat::Transaction::Step> TransactionStepList; 00066 00067 public: 00068 ZYppCommitResult(); 00069 ZYppCommitResult( const Pathname & root_r ); 00070 00071 public: 00076 const Pathname & root() const; 00077 00085 const sat::Transaction & transaction() const; 00086 00088 sat::Transaction & rTransaction(); 00089 00093 const TransactionStepList & transactionStepList() const; 00094 00096 TransactionStepList & rTransactionStepList(); 00097 00125 const UpdateNotifications & updateMessages() const; 00126 00130 UpdateNotifications & rUpdateMessages(); 00131 00132 public: 00133 00156 bool allDone() const 00157 { return transaction().actionEmpty( ~sat::Transaction::STEP_DONE ); } 00158 00160 bool noError() const 00161 { return transaction().actionEmpty( sat::Transaction::STEP_ERROR ); } 00163 00164 public: 00171 typedef std::list<PoolItem> PoolItemList; 00175 int _result ZYPP_DEPRECATED; 00179 PoolItemList _errors ZYPP_DEPRECATED; 00183 PoolItemList _remaining ZYPP_DEPRECATED; 00187 PoolItemList _srcremaining ZYPP_DEPRECATED; 00189 00190 public: 00192 class Impl; 00193 private: 00195 RWCOW_pointer<Impl> _pimpl; 00196 }; 00198 00200 std::ostream & operator<<( std::ostream & str, const ZYppCommitResult & obj ); 00201 00203 } // namespace zypp 00205 #endif // ZYPP_ZYPPCOMMITRESULT_H