zypp::ui::Selectable Class Reference

Collects PoolItems of same kind and name. More...

#include <Selectable.h>

Inheritance diagram for zypp::ui::Selectable:

zypp::base::ReferenceCounted NonCopyable List of all members.

Query objects fate in case of commit.

enum  Fate { TO_DELETE = -1, UNMODIFIED = 0, TO_INSTALL = 1 }
Fate fate () const
bool unmodified () const
 True if either to delete or to install.
bool toModify () const
 True if either to delete or to install.
bool toDelete () const
 True if to delete.
bool toInstall () const
 True if to install.

Public Types

typedef intrusive_ptr< SelectablePtr
typedef intrusive_ptr< const
Selectable
constPtr
typedef SelectableTraits::available_iterator available_iterator
 Iterates over ResObject::constPtr.
typedef SelectableTraits::availableItem_size_type size_type
typedef shared_ptr< ImplImpl_Ptr

Public Member Functions

ResObject::Kind kind () const
 The ResObjects kind.
const std::string & name () const
 The ResObjects name.
ResObject::constPtr installedObj () const
 Installed object.
ResObject::constPtr candidateObj () const
 Best among available objects.
ResObject::constPtr setCandidate (ResObject::constPtr byUser_r)
 Set a candidate (out of available objects).
ResObject::constPtr theObj () const
 Best among all objects.
size_type availableObjs () const
 Number of available objects.
available_iterator availableBegin () const
available_iterator availableEnd () const
 Selectable (Impl_Ptr pimpl_r)
 Default ctor.
Query for objects within this Selectable.
bool hasObject () const
 True if either installed or candidate object is present.
bool hasInstalledObj () const
 True if installed object is present.
bool hasCandidateObj () const
 True if candidate object is present.
bool hasBothObjects () const
 True if installed and candidate object is present.
bool hasInstalledObjOnly () const
 True if installed object is present but no candidate.
bool hasCandidateObjOnly () const
 True if candidate object is present but no installed.
Special inteface for Y2UI.
Note:
This interface acts on ResStatus::USER level. The Status enum, and allowed state transitions are tightly related to the Y2UI. It might be not verry usefull outside the Y2UI.


Status status () const
 Return the current Status.
bool set_status (const Status state_r)
 Try to set a new Status.
ResStatus::TransactByValue modifiedBy () const
 Return who caused the modification.
bool hasLicenceConfirmed () const
 Return value of LicenceConfirmed bit.
void setLicenceConfirmed (bool val_r=true)
 Set LicenceConfirmed bit.

Private Member Functions

 ~Selectable ()
 Dtor.

Private Attributes

RW_pointer< Impl_pimpl
 Pointer to implementation.

Friends

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

Classes

struct  Impl
 Selectable implementation. More...

Detailed Description

Collects PoolItems of same kind and name.

Selectable is a status wrapper. That's why it offers the PoolItems ResObjects but hides their individual ResStatus. The ui::Status is calculated from (and transated to) PoolItems individual ResStatus values.

Note:
There's one Selectable per installed item, in case more than one item is intalled.
Todo:
Make it a _Ref.

Definition at line 48 of file Selectable.h.


Member Typedef Documentation

typedef intrusive_ptr<Selectable> zypp::ui::Selectable::Ptr
 

Definition at line 53 of file Selectable.h.

typedef intrusive_ptr<const Selectable> zypp::ui::Selectable::constPtr
 

Definition at line 54 of file Selectable.h.

typedef SelectableTraits::available_iterator zypp::ui::Selectable::available_iterator
 

Iterates over ResObject::constPtr.

Definition at line 57 of file Selectable.h.

typedef SelectableTraits::availableItem_size_type zypp::ui::Selectable::size_type
 

Definition at line 58 of file Selectable.h.

typedef shared_ptr<Impl> zypp::ui::Selectable::Impl_Ptr
 

Definition at line 179 of file Selectable.h.


Member Enumeration Documentation

enum zypp::ui::Selectable::Fate
 

Enumerator:
TO_DELETE 
UNMODIFIED 
TO_INSTALL 

Definition at line 127 of file Selectable.h.


Constructor & Destructor Documentation

zypp::ui::Selectable::Selectable Impl_Ptr  pimpl_r  ) 
 

Default ctor.

Definition at line 30 of file Selectable.cc.

zypp::ui::Selectable::~Selectable  )  [private]
 

Dtor.

Definition at line 39 of file Selectable.cc.


Member Function Documentation

ResObject::Kind zypp::ui::Selectable::kind  )  const
 

The ResObjects kind.

Definition at line 49 of file Selectable.cc.

References _pimpl.

const std::string & zypp::ui::Selectable::name  )  const
 

The ResObjects name.

Definition at line 52 of file Selectable.cc.

References _pimpl.

ResObject::constPtr zypp::ui::Selectable::installedObj  )  const
 

Installed object.

Definition at line 61 of file Selectable.cc.

References _pimpl.

Referenced by hasBothObjects(), hasCandidateObjOnly(), hasInstalledObj(), hasInstalledObjOnly(), and hasObject().

ResObject::constPtr zypp::ui::Selectable::candidateObj  )  const
 

Best among available objects.

+ The user selected candiate, or a default.

Definition at line 64 of file Selectable.cc.

References _pimpl.

Referenced by hasBothObjects(), hasCandidateObj(), hasCandidateObjOnly(), hasInstalledObjOnly(), and hasObject().

ResObject::constPtr zypp::ui::Selectable::setCandidate ResObject::constPtr  byUser_r  ) 
 

Set a candidate (out of available objects).

Returns:
The new candidate, or NULL if choice was invalid (NULL or not among availableObjs). An invalid choice selects the default candidate.

Definition at line 67 of file Selectable.cc.

References _pimpl.

ResObject::constPtr zypp::ui::Selectable::theObj  )  const
 

Best among all objects.

Definition at line 70 of file Selectable.cc.

References _pimpl.

Selectable::size_type zypp::ui::Selectable::availableObjs  )  const
 

Number of available objects.

Definition at line 73 of file Selectable.cc.

References _pimpl.

Selectable::available_iterator zypp::ui::Selectable::availableBegin  )  const
 

Definition at line 76 of file Selectable.cc.

References _pimpl.

Selectable::available_iterator zypp::ui::Selectable::availableEnd  )  const
 

Definition at line 80 of file Selectable.cc.

References _pimpl.

bool zypp::ui::Selectable::hasObject  )  const [inline]
 

True if either installed or candidate object is present.

Definition at line 99 of file Selectable.h.

References candidateObj(), and installedObj().

bool zypp::ui::Selectable::hasInstalledObj  )  const [inline]
 

True if installed object is present.

Definition at line 103 of file Selectable.h.

References installedObj().

bool zypp::ui::Selectable::hasCandidateObj  )  const [inline]
 

True if candidate object is present.

Definition at line 107 of file Selectable.h.

References candidateObj().

bool zypp::ui::Selectable::hasBothObjects  )  const [inline]
 

True if installed and candidate object is present.

Definition at line 111 of file Selectable.h.

References candidateObj(), and installedObj().

bool zypp::ui::Selectable::hasInstalledObjOnly  )  const [inline]
 

True if installed object is present but no candidate.

Definition at line 115 of file Selectable.h.

References candidateObj(), and installedObj().

bool zypp::ui::Selectable::hasCandidateObjOnly  )  const [inline]
 

True if candidate object is present but no installed.

Definition at line 119 of file Selectable.h.

References candidateObj(), and installedObj().

Selectable::Fate zypp::ui::Selectable::fate  )  const
 

Definition at line 94 of file Selectable.cc.

References zypp::ui::S_AutoDel, zypp::ui::S_AutoInstall, zypp::ui::S_AutoUpdate, zypp::ui::S_Del, zypp::ui::S_Install, zypp::ui::S_KeepInstalled, zypp::ui::S_NoInst, zypp::ui::S_Protected, zypp::ui::S_Taboo, zypp::ui::S_Update, status(), TO_DELETE, TO_INSTALL, and UNMODIFIED.

Referenced by toDelete(), toInstall(), toModify(), and unmodified().

bool zypp::ui::Selectable::unmodified  )  const [inline]
 

True if either to delete or to install.

Definition at line 136 of file Selectable.h.

References fate(), and UNMODIFIED.

bool zypp::ui::Selectable::toModify  )  const [inline]
 

True if either to delete or to install.

Definition at line 140 of file Selectable.h.

References fate(), and UNMODIFIED.

bool zypp::ui::Selectable::toDelete  )  const [inline]
 

True if to delete.

Definition at line 144 of file Selectable.h.

References fate(), and TO_DELETE.

bool zypp::ui::Selectable::toInstall  )  const [inline]
 

True if to install.

Definition at line 148 of file Selectable.h.

References fate(), and TO_INSTALL.

Status zypp::ui::Selectable::status  )  const
 

Return the current Status.

Definition at line 55 of file Selectable.cc.

References _pimpl.

Referenced by fate().

bool zypp::ui::Selectable::set_status const Status  state_r  ) 
 

Try to set a new Status.

Returns false if the transitions is not allowed.

Definition at line 58 of file Selectable.cc.

References _pimpl.

ResStatus::TransactByValue zypp::ui::Selectable::modifiedBy  )  const
 

Return who caused the modification.

Definition at line 84 of file Selectable.cc.

References _pimpl.

bool zypp::ui::Selectable::hasLicenceConfirmed  )  const
 

Return value of LicenceConfirmed bit.

Definition at line 87 of file Selectable.cc.

References _pimpl.

void zypp::ui::Selectable::setLicenceConfirmed bool  val_r = true  ) 
 

Set LicenceConfirmed bit.

Definition at line 90 of file Selectable.cc.

References _pimpl.


Friends And Related Function Documentation

std::ostream & operator<< std::ostream &  str,
const Selectable obj
[friend]
 

Stream output

Definition at line 124 of file Selectable.cc.


Member Data Documentation

RW_pointer<Impl> zypp::ui::Selectable::_pimpl [private]
 

Pointer to implementation.

Definition at line 188 of file Selectable.h.

Referenced by availableBegin(), availableEnd(), availableObjs(), candidateObj(), hasLicenceConfirmed(), installedObj(), kind(), modifiedBy(), name(), zypp::ui::operator<<(), set_status(), setCandidate(), setLicenceConfirmed(), status(), and theObj().


The documentation for this class was generated from the following files:
Generated on Thu Jul 6 00:07:35 2006 for zypp by  doxygen 1.4.6