libzypp  13.10.6
zypp::sat::Transaction Class Reference

Libsolv transaction wrapper. More...

#include <Transaction.h>

Inheritance diagram for zypp::sat::Transaction:
zypp::sat::SolvIterMixin< Transaction, detail::Transaction_const_iterator >

Classes

struct  FilterAction
 
struct  Impl
 Transaction implementation. More...
 
struct  LoadFromPoolType
 Ctor arg type. More...
 
class  Step
 A single step within a Transaction. More...
 

Public Types

enum  StepType { TRANSACTION_IGNORE = 0x00, TRANSACTION_ERASE = 0x10, TRANSACTION_INSTALL = 0x20, TRANSACTION_MULTIINSTALL = 0x30 }
 Type of (rpm) action to perform in a Step. More...
 
enum  StepStage { STEP_TODO = (1 << 0), STEP_DONE = (1 << 1), STEP_ERROR = (1 << 2) }
 Step action result. More...
 
typedef
detail::Transaction_iterator 
iterator
 
typedef
detail::Transaction_const_iterator 
const_iterator
 
- Public Types inherited from zypp::sat::SolvIterMixin< Transaction, detail::Transaction_const_iterator >
typedef size_t size_type
 
typedef
detail::Transaction_const_iterator 
Solvable_iterator
 
typedef transform_iterator
< asPoolItem,
Solvable_iterator
PoolItem_iterator
 
typedef transform_iterator
< ui::asSelectable,
UnifiedSolvable_iterator
Selectable_iterator
 

Public Member Functions

 ZYPP_DECLARE_FLAGS (StepStages, StepStage)
 
 Transaction ()
 Default ctor: empty transaction. More...
 
 Transaction (LoadFromPoolType)
 Ctor loading the default pools transaction. More...
 
 ~Transaction ()
 Dtor. More...
 
bool valid () const
 Whether transaction actually contains data and also fits the current pools content. More...
 
 operator bool () const
 Validate object in a boolean context: valid. More...
 
bool order ()
 Order transaction steps for commit. More...
 
bool empty () const
 Whether the transaction contains any steps. More...
 
size_t size () const
 Number of steps in transaction steps. More...
 
const_iterator begin () const
 Iterator to the first TransactionStep. More...
 
iterator begin ()
 
const_iterator end () const
 Iterator behind the last TransactionStep. More...
 
iterator end ()
 
const_iterator find (const sat::Solvable &solv_r) const
 Return iterator pointing to solv_r or end. More...
 
iterator find (const sat::Solvable &solv_r)
 
const_iterator find (const ResObject::constPtr &resolvable_r) const
 
iterator find (const ResObject::constPtr &resolvable_r)
 
const_iterator find (const PoolItem &pi_r) const
 
iterator find (const PoolItem &pi_r)
 
- Public Member Functions inherited from zypp::sat::SolvIterMixin< Transaction, detail::Transaction_const_iterator >
bool empty () const
 Whether the collection is epmty. More...
 
size_type size () const
 Size of the collection. More...
 
bool contains (const _Solv &solv_r) const
 Whether collection contains a specific Solvable. More...
 
Solvable_iterator solvableBegin () const
 
Solvable_iterator solvableEnd () const
 
PoolItem_iterator poolItemBegin () const
 
PoolItem_iterator poolItemEnd () const
 
Selectable_iterator selectableBegin () const
 
Selectable_iterator selectableEnd () const
 

Static Public Attributes

static constexpr LoadFromPoolType loadFromPool = LoadFromPoolType()
 

Private Attributes

RW_pointer< Impl_pimpl
 Pointer to implementation. More...
 

Friends

std::ostream & operator<< (std::ostream &str, const Transaction &obj)
 
std::ostream & dumpOn (std::ostream &str, const Transaction &obj)
 
bool operator== (const Transaction &lhs, const Transaction &rhs)
 

Related Functions

(Note that these are not member functions.)

std::ostream & operator<< (std::ostream &str, const Transaction &obj)
 
std::ostream & dumpOn (std::ostream &str, const Transaction &obj)
 
bool operator== (const Transaction &lhs, const Transaction &rhs)
 
bool operator!= (const Transaction &lhs, const Transaction &rhs)
 

Iterate action steps (omit TRANSACTION_IGNORE steps).

All these methods allow to pass an optional OR'd combination of StepStages as filter.

Per default all steps are processed/counted.

* Transaction trans;
* for_( it, trans.actionBegin(~sat::Transaction::STEP_DONE), trans.actionEnd() )
* {
* ... // process all steps not DONE (ERROR and TODO)
* }
*
typedef filter_iterator
< FilterAction, const_iterator
action_iterator
 
bool actionEmpty (StepStages filter_r=StepStages()) const
 Whether the [filtered] transaction contains any steps . More...
 
size_t actionSize (StepStages filter_r=StepStages()) const
 Number of steps in [filtered] transaction steps. More...
 
action_iterator actionBegin (StepStages filter_r=StepStages()) const
 Pointer to the 1st action step in [filtered] transaction. More...
 
action_iterator actionEnd () const
 Pointer behind the last action step in transaction. More...
 

Additional Inherited Members

- Protected Member Functions inherited from zypp::sat::SolvIterMixin< Transaction, detail::Transaction_const_iterator >
 SolvIterMixin ()
 
 SolvIterMixin (const SolvIterMixin &)
 
 ~SolvIterMixin ()
 
void operator= (const SolvIterMixin &)
 

Detailed Description

Libsolv transaction wrapper.

Note
Note that Transaction is derived from sat::SolvIterMixin which makes PoolItem and Selectable iterators automatically available.
Changing the ResPool content (loading/unloading repositories) invalidates all outstanding transaction data.
See Also
valid.
Note
.The transaction may inlude steps of type TRANSACTION_IGNORE which do not cause/require any specific action. To skip those informal steps when iterating, use the actionBegin /actionEnd methods.

Definition at line 54 of file Transaction.h.

Member Typedef Documentation

Member Enumeration Documentation

Type of (rpm) action to perform in a Step.

Enumerator
TRANSACTION_IGNORE 

[ ] Nothing (includes implicit deletes due to obsoletes and non-package actions)

TRANSACTION_ERASE 

[-] Delete item

TRANSACTION_INSTALL 

[+] Install(update) item

TRANSACTION_MULTIINSTALL 

[M] Install(multiversion) item (

See Also
ZConfig::multiversion)

Definition at line 65 of file Transaction.h.

Step action result.

Enumerator
STEP_TODO 

[__] unprocessed

STEP_DONE 

[OK] success

STEP_ERROR 

[**] error

Definition at line 74 of file Transaction.h.

Constructor & Destructor Documentation

zypp::sat::Transaction::Transaction ( )

Default ctor: empty transaction.

Definition at line 301 of file Transaction.cc.

zypp::sat::Transaction::Transaction ( LoadFromPoolType  )

Ctor loading the default pools transaction.

Definition at line 305 of file Transaction.cc.

zypp::sat::Transaction::~Transaction ( )

Dtor.

Definition at line 309 of file Transaction.cc.

Member Function Documentation

zypp::sat::Transaction::ZYPP_DECLARE_FLAGS ( StepStages  ,
StepStage   
)
bool zypp::sat::Transaction::valid ( ) const

Whether transaction actually contains data and also fits the current pools content.

Definition at line 312 of file Transaction.cc.

zypp::sat::Transaction::operator bool ( ) const
inlineexplicit

Validate object in a boolean context: valid.

Definition at line 102 of file Transaction.h.

bool zypp::sat::Transaction::order ( )

Order transaction steps for commit.

It's cheap to call it for an aleready ordered Transaction. This invalidates outstanding iterators. Returns whether Transaction is valid.

Definition at line 315 of file Transaction.cc.

bool zypp::sat::Transaction::empty ( ) const

Whether the transaction contains any steps.

Definition at line 318 of file Transaction.cc.

size_t zypp::sat::Transaction::size ( ) const

Number of steps in transaction steps.

Definition at line 321 of file Transaction.cc.

Transaction::const_iterator zypp::sat::Transaction::begin ( ) const

Iterator to the first TransactionStep.

Definition at line 324 of file Transaction.cc.

Transaction::iterator zypp::sat::Transaction::begin ( )

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 327 of file Transaction.cc.

Transaction::const_iterator zypp::sat::Transaction::end ( ) const

Iterator behind the last TransactionStep.

Definition at line 330 of file Transaction.cc.

Transaction::iterator zypp::sat::Transaction::end ( )

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 333 of file Transaction.cc.

Transaction::const_iterator zypp::sat::Transaction::find ( const sat::Solvable solv_r) const

Return iterator pointing to solv_r or end.

Definition at line 336 of file Transaction.cc.

Transaction::iterator zypp::sat::Transaction::find ( const sat::Solvable solv_r)

Definition at line 339 of file Transaction.cc.

Transaction::const_iterator zypp::sat::Transaction::find ( const ResObject::constPtr resolvable_r) const
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 341 of file Transaction.h.

Transaction::iterator zypp::sat::Transaction::find ( const ResObject::constPtr resolvable_r)
inline

Definition at line 344 of file Transaction.h.

Transaction::const_iterator zypp::sat::Transaction::find ( const PoolItem pi_r) const
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 347 of file Transaction.h.

Transaction::iterator zypp::sat::Transaction::find ( const PoolItem pi_r)
inline

Definition at line 350 of file Transaction.h.

bool zypp::sat::Transaction::actionEmpty ( StepStages  filter_r = StepStages()) const
inline

Whether the [filtered] transaction contains any steps .

Definition at line 375 of file Transaction.h.

size_t zypp::sat::Transaction::actionSize ( StepStages  filter_r = StepStages()) const
inline

Number of steps in [filtered] transaction steps.

Definition at line 378 of file Transaction.h.

Transaction::action_iterator zypp::sat::Transaction::actionBegin ( StepStages  filter_r = StepStages()) const
inline

Pointer to the 1st action step in [filtered] transaction.

Definition at line 369 of file Transaction.h.

Transaction::action_iterator zypp::sat::Transaction::actionEnd ( ) const
inline

Pointer behind the last action step in transaction.

Definition at line 372 of file Transaction.h.

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  str,
const Transaction obj 
)
friend

Definition at line 342 of file Transaction.cc.

std::ostream& dumpOn ( std::ostream &  str,
const Transaction obj 
)
friend

Definition at line 345 of file Transaction.cc.

bool operator== ( const Transaction lhs,
const Transaction rhs 
)
friend

Definition at line 354 of file Transaction.cc.

std::ostream & operator<< ( std::ostream &  str,
const Transaction obj 
)
related

Stream output

Definition at line 342 of file Transaction.cc.

std::ostream & dumpOn ( std::ostream &  str,
const Transaction obj 
)
related

Verbose stream output

Definition at line 345 of file Transaction.cc.

bool operator== ( const Transaction lhs,
const Transaction rhs 
)
related

Definition at line 354 of file Transaction.cc.

bool operator!= ( const Transaction lhs,
const Transaction rhs 
)
related

Definition at line 193 of file Transaction.h.

Member Data Documentation

constexpr LoadFromPoolType zypp::sat::Transaction::loadFromPool = LoadFromPoolType()
static

Definition at line 85 of file Transaction.h.

RW_pointer<Impl> zypp::sat::Transaction::_pimpl
private

Pointer to implementation.

Definition at line 175 of file Transaction.h.


The documentation for this class was generated from the following files: