#include "zypp/base/PtrTypes.h"
#include "zypp/base/Flags.h"
-#include "zypp/base/SafeBool.h"
#include "zypp/base/Iterator.h"
#include "zypp/base/DefaultIntegral.h"
#include "zypp/sat/SolvIterMixin.h"
#include "zypp/sat/Solvable.h"
+#include "zypp/sat/Queue.h"
#include "zypp/PoolItem.h"
class Transaction_const_iterator;
}
- /** Satsolver transaction wrapper.
+ /** Libsolv transaction wrapper.
* \note Note that Transaction is derived from \ref sat::SolvIterMixin which
* makes PoolItem and Selectable iterators automatically available.
* \note Changing the \ref ResPool content (loading/unloading repositories)
* when iterating, use the \ref actionBegin /\ref actionEnd methods.
*/
class Transaction : public SolvIterMixin<Transaction, detail::Transaction_const_iterator>
- , protected base::SafeBool<Transaction>
{
friend std::ostream & operator<<( std::ostream & str, const Transaction & obj );
friend std::ostream & dumpOn( std::ostream & str, const Transaction & obj );
ZYPP_DECLARE_FLAGS(StepStages,StepStage);
public:
+ struct LoadFromPoolType {}; ///< Ctor arg type
+ static constexpr LoadFromPoolType loadFromPool = LoadFromPoolType();
+
+ public:
/** Default ctor: empty transaction. */
Transaction();
- /** Ctor cloning a sat transaction. */
- Transaction( ::_Transaction & trans_r );
+ /** Ctor loading the default pools transaction. */
+ Transaction( LoadFromPoolType );
/** Dtor */
~Transaction();
bool valid() const;
/** Validate object in a boolean context: valid */
- using base::SafeBool<Transaction>::operator bool_type;
+ explicit operator bool() const
+ { return valid(); }
/** Order transaction steps for commit.
* It's cheap to call it for an aleready ordered \ref Transaction.
//@}
- private:
- friend base::SafeBool<Transaction>::operator bool_type() const;
- /** Validate object in a boolean context. */
- bool boolTest() const
- { return valid(); }
+ public:
+ /** Return all packages that would be installed after the transaction is run.
+ * The new packages are put at the head of the queue, the number of new
+ * packages is returned. (wraps libsolv::transaction_installedresult) */
+ int installedResult( Queue & result_r ) const;
+
+ /** Return the ident strings of all packages that would be auto-installed after the transaction is run. */
+ StringQueue autoInstalled() const;
+
+ /** Set the ident strings of all packages that would be auto-installed after the transaction is run. */
+ void autoInstalled( const StringQueue & queue_r );
+
public:
/** Implementation */
class Impl;