47 {
return backup( status_r ); }
82 if ( ! status.
setLock(
false, causer_r ) )
return false;
83 if ( ! status.
setTransact(
true, causer_r ) )
return false;
91 if ( ! status.
setTransact(
false, causer_r ) )
return false;
92 if ( ! status.
setLock(
true, causer_r ) )
return false;
100 if ( ! status.
setTransact(
false, causer_r ) )
return false;
101 if ( ! status.
setLock(
false, causer_r ) )
return false;
109 template <
class _Iter>
112 for_( it, begin_r, end_r )
113 if ( ! (this->*action_r)( *it, causer_r ) )
132 ,
inst( impl.installedObj() )
133 ,
cand( impl.candidateObj() )
143 {
return bool(
inst); }
146 {
return bool(
cand); }
169 if ( !
cand->multiversionInstall() )
227 it->status().setTransact(
false,
causer );
228 it->status().setLock(
true,
causer );
340 return self.setProtected();
342 return self.setTaboo();
351 return self.setDelete();
355 return self.hasCandidateOnly() &&
self.setInstall();
359 return self.hasBoth() &&
self.setInstall();
363 return self.hasInstalled() &&
self.unset();
367 return !
self.hasInstalled() &&
self.unset();
378 if ( newCandidate_r )
382 if ( *it == newCandidate_r )
392 PoolItem trans( transactingCandidate() );
393 if ( trans && trans != newCandidate )
411 return _candidate = newCandidate;
440 std::vector<PoolItem> i;
441 std::vector<PoolItem> a;
444 if ( identical( *it, pi_r ) )
447 if ( identical( *it, pi_r ) )
486 if ( i.empty() && ! a.empty() )
491 if ( ! cand.status().setTransact(
true, causer_r ) )
return backup.
restore();
497 if ( ! i.empty() && ! a.empty() )
504 if ( ! cand.status().setTransact(
true, causer_r ) )
return backup.
restore();
534 std::vector<PoolItem> i;
535 std::vector<PoolItem> a;
540 if ( identical( *it, pi_r ) )
548 if ( identical( *it, pi_r ) )
568 for_( it, i.begin(), i.end() )
569 if ( it->status().isLocked() )
574 bool allALocked =
true;
575 for_( it, a.begin(), a.end() )
576 if ( ! it->status().isLocked() )
590 && ( ta ? ta : *a.begin() ).
status().isSatisfied() )
ResStatus::TransactByValue Causer
available_iterator availableEnd() const
ResStatus::TransactByValue modifiedBy() const
Return who caused the modification.
IdString ident() const
The identifier.
installed_iterator installedEnd() const
Status
UI status Status values calculated by Selectable.
bool hasCandidate() const
IdString ident() const
The identifier.
bool transact(const PoolItem &pi_r, Causer causer_r)
highevel set transact (force unlock).
PoolItem installedObj() const
The last Installed object.
ResObject::Kind kind() const
The ResObjects kind.
bool setStatus(Status state_r, ResStatus::TransactByValue causer_r)
bool setLock(const PoolItem &pi_r, bool yesno_r, Causer causer_r)
lowlevel ResStatus::setLock
Status pickStatus(const PoolItem &pi_r) const
bool setTransactTrue(const PoolItem &pi_r, Causer causer_r)
lowlevel ResStatus::setTransact(true).
bool allCandidatesLocked() const
Status status() const
Return the current Status.
bool hasInstalledOnly() const
ResStatus & backup(const PoolItem &pi_r)
Simple ResStatus backup stack.
#define for_(IT, BEG, END)
Convenient for-loops using iterator.
PoolItem candidateObj() const
Best among available objects.
ResObject::Kind kind() const
PoolItem setCandidate(const PoolItem &newCandidate_r, ResStatus::TransactByValue causer_r)
Set a userCandidate (out of available objects).
std::vector< resstatus::StatusBackup > _backup
bool hasCandidateOnly() const
ResStatus & operator()(const PoolItem &pi_r)
bool identicalInstalled(const PoolItem &rhs) const
True if rhs has the same content as an installed one.
available_const_iterator availableEnd() const
bool maySetTransact(bool val_r, TransactByValue causer)
ResStatus::TransactByValue causer
available_iterator availableBegin() const
const Selectable::Impl & _impl
bool forEach(_Iter begin_r, _Iter end_r, Action action_r, Causer causer_r)
Highlevel action on range of items.
SelectableTraits::available_const_iterator available_const_iterator
ResStatus & backup(ResStatus &status_r)
Backup status.
ResStatus & status() const
Returns the current status.
installed_iterator installedBegin() const
bool setLock(bool toLock_r, TransactByValue causer_r)
Apply a lock (prevent transaction).
bool resetTransactingCandidates()
StatusHelper(const Selectable::Impl &impl, ResStatus::TransactByValue causer_r)
bool multiversionInstall() const
Whether different versions of this package can be installed at the same time.
Selectable::Impl::available_const_iterator available_const_iterator
bool lock(const PoolItem &pi_r, Causer causer_r)
highlevel set locked.
bool isPseudoInstalled(ResKind kind_r)
Those are denoted to be installed, if the solver verifies them as being satisfied.
PoolItem installedObj() const
Installed object (transacting ot highest version).
bool setPickStatus(const PoolItem &pi_r, Status state_r, ResStatus::TransactByValue causer_r=ResStatus::USER)
Assign a new status to a specific item.
bool allInstalledLocked() const
PoolItem candidateObj() const
The 'best' or 'most interesting' among all available objects.
bool setTransact(bool toTansact_r, TransactByValue causer_r)
Toggle between TRANSACT and KEEP_STATE.
Selectable implementation.
bool(StatusBackup::* Action)(const PoolItem &, Causer)
Highlevel action.
sat::Solvable satSolvable() const
Return the corresponding sat::Solvable.
bool restore()
Restore all status.
installed_iterator installedEnd() const
bool unlock(const PoolItem &pi_r, Causer causer_r)
highlevel unlock (also unsets transact).
Reference to a PoolItem connecting ResObject and ResStatus.
bool setPickStatus(const PoolItem &pi_r, Status state_r, ResStatus::TransactByValue causer_r)
bool setTransact(const PoolItem &pi_r, bool yesno_r, Causer causer_r)
lowlevel ResStatus::setTransact
bool pickInstall(const PoolItem &pi_r, ResStatus::TransactByValue causer_r, bool yesno_r)
bool hasInstalled() const
bool setTransactFalse(const PoolItem &pi_r, Causer causer_r)
lowlevel ResStatus::setTransact(false).
ResStatus & operator()(ResStatus &status_r)
Backup status.
bool pickDelete(const PoolItem &pi_r, ResStatus::TransactByValue causer_r, bool yesno_r)
TransactByValue getTransactByValue() const
installed_iterator installedBegin() const
available_const_iterator availableBegin() const