Imported Upstream version 15.10.0
[platform/upstream/libzypp.git] / zypp / sat / Transaction.cc
index 67502ec..d351aa4 100644 (file)
@@ -18,7 +18,7 @@ extern "C"
 #include "zypp/base/SerialNumber.h"
 #include "zypp/base/DefaultIntegral.h"
 #include "zypp/base/NonCopyable.h"
-#include "zypp/base/Tr1hash.h"
+#include "zypp/base/Hash.h"
 
 #include "zypp/sat/detail/PoolImpl.h"
 #include "zypp/sat/Transaction.h"
@@ -50,8 +50,8 @@ namespace zypp
       friend std::ostream & operator<<( std::ostream & str, const Impl & obj );
 
       public:
-       typedef std::tr1::unordered_set<detail::IdType> set_type;
-       typedef std::tr1::unordered_map<detail::IdType,detail::IdType> map_type;
+       typedef std::unordered_set<detail::IdType> set_type;
+       typedef std::unordered_map<detail::IdType,detail::IdType> map_type;
 
        struct PostMortem
        {
@@ -67,14 +67,14 @@ namespace zypp
          Edition  _edition;
          Arch     _arch;
        };
-       typedef std::tr1::unordered_map<detail::IdType,PostMortem> pmmap_type;
+       typedef std::unordered_map<detail::IdType,PostMortem> pmmap_type;
 
       public:
        Impl()
          : _trans( ::transaction_create( nullptr ) )
-       { memset( _trans, 0, sizeof(_trans) ); }
+       { memset( _trans, 0, sizeof(*_trans) ); }
 
-       Impl( Default )
+       Impl( LoadFromPoolType )
          : _watcher( myPool().serial() )
          , _trans( nullptr )
        {
@@ -89,7 +89,7 @@ namespace zypp
          Queue noobsq;
          for_( it, sat::Pool::instance().multiversionBegin(), sat::Pool::instance().multiversionEnd() )
          {
-           noobsq.push( SOLVER_NOOBSOLETES | SOLVABLE_NAME );
+           noobsq.push( SOLVER_NOOBSOLETES | SOLVER_SOLVABLE_NAME );
            noobsq.push( it->id() );
          }
          Map noobsmap;
@@ -186,6 +186,16 @@ namespace zypp
        { detail::IdType * it( _find( solv_r ) ); return it ? iterator( self_r, it ) : end( self_r ); }
 
       public:
+       int installedResult( Queue & result_r ) const
+       { return ::transaction_installedresult( _trans, result_r ); }
+
+       StringQueue autoInstalled() const
+       { return _autoInstalled; }
+
+       void autoInstalled( const StringQueue & queue_r )
+       { _autoInstalled = queue_r; }
+
+      public:
        StepType stepType( Solvable solv_r ) const
        {
          if ( ! solv_r )
@@ -277,6 +287,8 @@ namespace zypp
        set_type        _systemErase;   // @System packages to be eased (otherse are TRANSACTION_IGNORE)
        pmmap_type      _pmMap;         // Post mortem data of deleted @System solvables
 
+       StringQueue     _autoInstalled; // ident strings of all packages that would be auto-installed after the transaction is run.
+
       public:
         /** Offer default Impl. */
         static shared_ptr<Impl> nullimpl()
@@ -302,8 +314,8 @@ namespace zypp
       : _pimpl( Impl::nullimpl() )
     {}
 
-    Transaction::Transaction( Default )
-      : _pimpl( new Impl( Default() ) )
+    Transaction::Transaction( LoadFromPoolType )
+      : _pimpl( new Impl( loadFromPool ) )
     {}
 
     Transaction::~Transaction()
@@ -339,6 +351,15 @@ namespace zypp
     Transaction::iterator Transaction::find( const sat::Solvable & solv_r )
     { return _pimpl->find( _pimpl, solv_r ); }
 
+    int Transaction::installedResult( Queue & result_r ) const
+    { return _pimpl->installedResult( result_r ); }
+
+    StringQueue Transaction::autoInstalled() const
+    { return _pimpl->autoInstalled(); }
+
+    void Transaction::autoInstalled( const StringQueue & queue_r )
+    { _pimpl->autoInstalled( queue_r ); }
+
     std::ostream & operator<<( std::ostream & str, const Transaction & obj )
     { return str << *obj._pimpl; }