#include <Transaction.h>
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 . | |
size_t | actionSize (StepStages filter_r=StepStages()) const |
Number of steps in [filtered] transaction steps. | |
action_iterator | actionBegin (StepStages filter_r=StepStages()) const |
Pointer to the 1st action step in [filtered] transaction. | |
action_iterator | actionEnd () const |
Pointer behind the last action step in transaction. | |
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 Member Functions | |
ZYPP_DECLARE_FLAGS (StepStages, StepStage) | |
Transaction () | |
Default ctor: empty transaction. | |
Transaction (::_Transaction &trans_r) | |
Ctor cloning a sat transaction. | |
~Transaction () | |
Dtor. | |
bool | valid () const |
Whether transaction actually contains data and also fits the current pools content. | |
bool | order () |
Order transaction steps for commit. | |
bool | empty () const |
Whether the transaction contains any steps. | |
size_t | size () const |
Number of steps in transaction steps. | |
const_iterator | begin () const |
Iterator to the first TransactionStep. | |
iterator | begin () |
const_iterator | end () const |
Iterator behind the last TransactionStep. | |
iterator | end () |
const_iterator | find (const sat::Solvable &solv_r) const |
Return iterator pointing to solv_r or end. | |
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) |
Private Member Functions | |
friend | base::SafeBool () const |
bool | boolTest () const |
Validate object in a boolean context. | |
Private Attributes | |
RW_pointer< Impl > | _pimpl |
Pointer to implementation. | |
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.) | |
bool | operator!= (const Transaction &lhs, const Transaction &rhs) |
Classes | |
struct | FilterAction |
struct | Impl |
Transaction implementation. More... | |
class | Step |
A single step within a Transaction. More... |
Changing the ResPool content (loading/unloading repositories) invalidates all outstanding transaction data.
Definition at line 55 of file Transaction.h.
Definition at line 115 of file Transaction.h.
Definition at line 116 of file Transaction.h.
typedef filter_iterator<FilterAction,const_iterator> zypp::sat::Transaction::action_iterator |
Definition at line 153 of file Transaction.h.
Type of (rpm) action to perform in a Step.
Definition at line 67 of file Transaction.h.
zypp::sat::Transaction::Transaction | ( | ) |
zypp::sat::Transaction::Transaction | ( | ::_Transaction & | trans_r | ) |
zypp::sat::Transaction::~Transaction | ( | ) |
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 305 of file Transaction.cc.
References _pimpl.
Referenced by boolTest().
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 308 of file Transaction.cc.
References _pimpl.
Referenced by zypp::target::TargetImpl::commit().
bool zypp::sat::Transaction::empty | ( | ) | const |
Whether the transaction contains any steps.
Reimplemented from zypp::sat::SolvIterMixin< Derived, DerivedSolvable_iterator >.
Definition at line 311 of file Transaction.cc.
References _pimpl.
size_t zypp::sat::Transaction::size | ( | ) | const |
Number of steps in transaction steps.
Reimplemented from zypp::sat::SolvIterMixin< Derived, DerivedSolvable_iterator >.
Definition at line 314 of file Transaction.cc.
References _pimpl.
Transaction::const_iterator zypp::sat::Transaction::begin | ( | ) | const |
Iterator to the first TransactionStep.
Definition at line 317 of file Transaction.cc.
References _pimpl.
Referenced by zypp::target::TargetImpl::commit(), and zypp::sat::dumpOn().
Transaction::iterator zypp::sat::Transaction::begin | ( | ) |
Transaction::const_iterator zypp::sat::Transaction::end | ( | ) | const |
Iterator behind the last TransactionStep.
Definition at line 323 of file Transaction.cc.
References _pimpl.
Referenced by zypp::target::TargetImpl::commit(), zypp::pool::GetResolvablesToInsDel::debugDiffTransaction(), zypp::sat::dumpOn(), and find().
Transaction::iterator zypp::sat::Transaction::end | ( | ) |
Transaction::const_iterator zypp::sat::Transaction::find | ( | const sat::Solvable & | solv_r | ) | const |
Return iterator pointing to solv_r or end.
Definition at line 329 of file Transaction.cc.
References _pimpl.
Referenced by zypp::pool::GetResolvablesToInsDel::debugDiffTransaction(), and find().
Transaction::iterator zypp::sat::Transaction::find | ( | const sat::Solvable & | solv_r | ) |
Transaction::const_iterator zypp::sat::Transaction::find | ( | const ResObject::constPtr & | resolvable_r | ) | const [inline] |
Transaction::iterator zypp::sat::Transaction::find | ( | const ResObject::constPtr & | resolvable_r | ) | [inline] |
Transaction::const_iterator zypp::sat::Transaction::find | ( | const PoolItem & | pi_r | ) | const [inline] |
Transaction::iterator zypp::sat::Transaction::find | ( | const PoolItem & | pi_r | ) | [inline] |
bool zypp::sat::Transaction::actionEmpty | ( | StepStages | filter_r = StepStages() |
) | const [inline] |
Whether the [filtered] transaction contains any steps .
Definition at line 377 of file Transaction.h.
References actionBegin(), and actionEnd().
Referenced by zypp::ZYppCommitResult::allDone(), and zypp::ZYppCommitResult::noError().
size_t zypp::sat::Transaction::actionSize | ( | StepStages | filter_r = StepStages() |
) | const [inline] |
Number of steps in [filtered] transaction steps.
Definition at line 380 of file Transaction.h.
References actionBegin(), actionEnd(), and for_.
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 371 of file Transaction.h.
References zypp::make_filter_begin().
Referenced by actionEmpty(), actionSize(), and zypp::operator<<().
Transaction::action_iterator zypp::sat::Transaction::actionEnd | ( | ) | const [inline] |
Pointer behind the last action step in transaction.
Definition at line 374 of file Transaction.h.
References zypp::make_filter_end().
Referenced by actionEmpty(), actionSize(), and zypp::operator<<().
zypp::sat::Transaction::base::SafeBool | ( | ) | const [private] |
bool zypp::sat::Transaction::boolTest | ( | ) | const [inline, private] |
Validate object in a boolean context.
Definition at line 173 of file Transaction.h.
References valid().
std::ostream & operator<< | ( | std::ostream & | str, | |
const Transaction & | obj | |||
) | [friend] |
Stream output
Definition at line 335 of file Transaction.cc.
std::ostream & dumpOn | ( | std::ostream & | str, | |
const Transaction & | obj | |||
) | [friend] |
Verbose stream output
Definition at line 338 of file Transaction.cc.
bool operator== | ( | const Transaction & | lhs, | |
const Transaction & | rhs | |||
) | [friend] |
Definition at line 347 of file Transaction.cc.
bool operator!= | ( | const Transaction & | lhs, | |
const Transaction & | rhs | |||
) | [related] |
Definition at line 195 of file Transaction.h.
RW_pointer<Impl> zypp::sat::Transaction::_pimpl [private] |
Pointer to implementation.
Definition at line 177 of file Transaction.h.
Referenced by begin(), zypp::sat::detail::Transaction_const_iterator::dereference(), zypp::sat::detail::Transaction_iterator::dereference(), empty(), end(), find(), zypp::sat::operator<<(), zypp::sat::operator==(), order(), size(), and valid().