Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members

PMSelectable Class Reference

#include <PMSelectable.h>

Inheritance diagram for PMSelectable:

CountedRep Rep List of all members.

Public Types

typedef std::list< PMObjectPtr > PMObjectList
typedef bool(PMSelectable::* Test_method )() const
typedef bool(* Test_fnc )(const constPMSelectablePtr &sel_r)
enum  UI_Status {
  S_Protected, S_Taboo, S_Del, S_Update,
  S_Install, S_AutoDel, S_AutoUpdate, S_AutoInstall,
  S_KeepInstalled, S_NoInst
}
enum  Fate { TO_DELETE = -1, UNMODIFIED = 0, TO_INSTALL = 1 }

Public Member Functions

const PkgNamename () const
PMObjectPtr installedObj () const
PMObjectPtr candidateObj () const
unsigned availableObjs () const
PMObjectList::const_iterator av_begin () const
PMObjectList::const_iterator av_end () const
PMObjectList::const_reverse_iterator av_rbegin () const
PMObjectList::const_reverse_iterator av_rend () const
PMObjectPtr theObject () const
PMObjectPtr autoCandidate () const
PMObjectPtr userCandidate () const
PMObjectPtr bestCandidate () const
bool setUserCandidate (const PMObjectPtr &obj_r)
bool clrUserCandidate ()
bool set_status (const UI_Status state_r)
bool test_set_status (const UI_Status state_r)
UI_Status status () const
bool providesSources () const
bool set_source_install (const bool install_r)
bool source_install () const
Fate fate () const
void setNothingSelected ()
bool downgrade_condition () const
bool has_object () const
bool has_installed () const
bool has_candidate () const
bool has_both_objects () const
bool has_installed_only () const
bool has_candidate_only () const
bool to_modify () const
bool to_delete () const
bool to_install () const
bool by_user () const
bool by_appl () const
bool by_auto () const
bool is_taboo () const
bool user_unset ()
bool user_set_delete ()
bool user_set_install ()
bool user_set_taboo ()
bool user_clr_taboo ()
bool appl_unset ()
bool appl_set_delete ()
bool appl_force_install ()
bool appl_set_install ()
bool auto_unset ()
bool auto_set_delete ()
bool auto_force_install ()
bool auto_set_install ()
bool is_onSystem () const
bool is_offSystem () const
bool user_set_onSystem ()
bool user_set_offSystem ()
bool appl_set_onSystem ()
bool appl_set_offSystem ()
bool auto_set_onSystem ()
bool auto_set_offSystem ()
virtual std::ostream & dumpOn (std::ostream &str) const
std::ostream & dumpStateOn (std::ostream &str) const

Static Public Member Functions

bool test (const constPMSelectablePtr &sel_r, Test_method fnc_r)

Protected Member Functions

 PMSelectable ()
 PMSelectable (const PkgName &name_r)
virtual ~PMSelectable ()

Private Types

typedef bool(* ClistCompare )(const PMObjectPtr &lhs, const PMObjectPtr &rhs)

Private Member Functions

 REP_BODY (PMSelectable)
void _mgr_attach (PMManager *mgr_r)
void _mgr_detach ()
void _attach_obj (PMObjectPtr &obj_r)
void _detach_obj (PMObjectPtr &obj_r)
void setInstalledObj (PMObjectPtr obj_r)
void delInstalledObj ()
void clistAdd (PMObjectPtr obj_r)
void clistDel (PMObjectPtr obj_r)
void clistSort ()
void clistClearAll ()
void clearAll ()
bool isEmpty () const
void check () const
PMObjectList::iterator clistLookup (PMObjectPtr obj_r)
void chooseCandidateObj ()
void clearCandidateObj ()
bool intern_set_status (const UI_Status state_r, const bool doit)
bool do_set_onSystem (bool(PMSelectable::*fnc_unset)(), bool(PMSelectable::*fnc_install)())
bool do_set_offSystem (bool(PMSelectable::*fnc_unset)(), bool(PMSelectable::*fnc_delete)())

Static Private Member Functions

bool setCandidateOrder (PM::CandidateOrder neworder_r)
bool clistAVS (const PMObjectPtr &lhs, const PMObjectPtr &rhs)
bool clistASV (const PMObjectPtr &lhs, const PMObjectPtr &rhs)
bool clistIsBetter (const PMObjectPtr &lhs, const PMObjectPtr &rhs)

Private Attributes

PMManager_manager
SelState _state
PkgName _name
PMObjectPtr _installedObj
PMObjectPtr _candidateObj
PMObjectPtr _userCandidateObj
PMObjectList _candidateList

Static Private Attributes

ClistCompare _clistCompare = DEAFAULT_CLISTCOMPARE

Friends

std::ostream & operator<< (std::ostream &str, UI_Status obj)

Member Typedef Documentation

typedef bool(* PMSelectable::ClistCompare)( const PMObjectPtr & lhs, const PMObjectPtr & rhs ) [private]
 

typedef std::list<PMObjectPtr> PMSelectable::PMObjectList
 

typedef bool(* PMSelectable::Test_fnc)( const constPMSelectablePtr & sel_r )
 

General test function

typedef bool(PMSelectable::* PMSelectable::Test_method)() const
 

Test method like 'by_user()'


Member Enumeration Documentation

enum PMSelectable::Fate
 

Enumeration values:
TO_DELETE 
UNMODIFIED 
TO_INSTALL 

enum PMSelectable::UI_Status
 

Enumeration values:
S_Protected 
S_Taboo 
S_Del 
S_Update 
S_Install 
S_AutoDel 
S_AutoUpdate 
S_AutoInstall 
S_KeepInstalled 
S_NoInst 


Constructor & Destructor Documentation

PMSelectable::PMSelectable  )  [protected]
 

PMSelectable::PMSelectable const PkgName name_r  )  [protected]
 

PMSelectable::~PMSelectable  )  [protected, virtual]
 


Member Function Documentation

void PMSelectable::_attach_obj PMObjectPtr &  obj_r  )  [private]
 

void PMSelectable::_detach_obj PMObjectPtr &  obj_r  )  [private]
 

void PMSelectable::_mgr_attach PMManager mgr_r  )  [private]
 

void PMSelectable::_mgr_detach  )  [private]
 

bool PMSelectable::appl_force_install  )  [inline]
 

Application request to install the candidate object. Fails if no candidate object is present, or user requested delete or taboo. Does not check for downgrade_condition. Do not use it without need.

bool PMSelectable::appl_set_delete  )  [inline]
 

Application request to delete the installed object. Fails if no installed object is present, or user requested install or taboo.

bool PMSelectable::appl_set_install  )  [inline]
 

Application request to install the candidate object. Fails if no candidate object is present, or user requested delete or taboo. Fails if downgrade_condition is true.

bool PMSelectable::appl_set_offSystem  )  [inline]
 

do_set_offSystem requested by appl.

bool PMSelectable::appl_set_onSystem  )  [inline]
 

do_set_onSystem requested by appl.

bool PMSelectable::appl_unset  )  [inline]
 

Application request to clear state (neither delete nor install). Fails if user requested modification.

bool PMSelectable::auto_force_install  )  [inline]
 

Auto request to install the candidate object. Fails if no candidate object is present, or user/appl requested delete or taboo. Does not check for downgrade_condition. Do not use it without need.

bool PMSelectable::auto_set_delete  )  [inline]
 

Auto request to delete the installed object. Fails if no installed object is present, or user/appl requested install or taboo.

bool PMSelectable::auto_set_install  )  [inline]
 

Auto request to install the candidate object. Fails if no candidate object is present, or user/appl requested delete or taboo. Fails if downgrade_condition is true.

bool PMSelectable::auto_set_offSystem  )  [inline]
 

do_set_offSystem requested by auto.

bool PMSelectable::auto_set_onSystem  )  [inline]
 

do_set_onSystem requested by auto.

bool PMSelectable::auto_unset  )  [inline]
 

Auto request to clear state (neither delete nor install). Fails if user/appl requested modification.

PMObjectPtr PMSelectable::autoCandidate  )  const
 

Best among the availableObjs(). May be NULL, if no available is better than the installed.

PMObjectList::const_iterator PMSelectable::av_begin  )  const [inline]
 

Iterator for the list of available Objects.

PMObjectList::const_iterator PMSelectable::av_end  )  const [inline]
 

Iterator for the list of available Objects.

PMObjectList::const_reverse_iterator PMSelectable::av_rbegin  )  const [inline]
 

Iterator for the list of available Objects.

PMObjectList::const_reverse_iterator PMSelectable::av_rend  )  const [inline]
 

Iterator for the list of available Objects.

unsigned PMSelectable::availableObjs  )  const [inline]
 

Number of Objects with this name availavle on any enabled InstSrc. If the list is not empty, one among these might be choosen as candidate for an installation.

PMObjectPtr PMSelectable::bestCandidate  )  const [inline]
 

userCandidate() if not NULL. Otherwise autoCandidate().

bool PMSelectable::by_appl  )  const [inline]
 

True if modification was requested by application

bool PMSelectable::by_auto  )  const [inline]
 

True if modification was auto requested

bool PMSelectable::by_user  )  const [inline]
 

True if modification was requested by user

PMObjectPtr PMSelectable::candidateObj  )  const [inline]
 

The one among all available Objects with this name (from any enabled InstSrc), That could be actually installed.

Might be NULL, if no available Object is appropriate.

void PMSelectable::check  )  const [private]
 

void PMSelectable::chooseCandidateObj  )  [private]
 

void PMSelectable::clearAll  )  [private]
 

void PMSelectable::clearCandidateObj  )  [private]
 

void PMSelectable::clistAdd PMObjectPtr  obj_r  )  [private]
 

bool PMSelectable::clistASV const PMObjectPtr &  lhs,
const PMObjectPtr &  rhs
[static, private]
 

bool PMSelectable::clistAVS const PMObjectPtr &  lhs,
const PMObjectPtr &  rhs
[static, private]
 

void PMSelectable::clistClearAll  )  [private]
 

void PMSelectable::clistDel PMObjectPtr  obj_r  )  [private]
 

bool PMSelectable::clistIsBetter const PMObjectPtr &  lhs,
const PMObjectPtr &  rhs
[static, private]
 

PMSelectable::PMObjectList::iterator PMSelectable::clistLookup PMObjectPtr  obj_r  )  [private]
 

void PMSelectable::clistSort  )  [private]
 

bool PMSelectable::clrUserCandidate  )  [inline]
 

Unset the userCandidate().

void PMSelectable::delInstalledObj  )  [inline, private]
 

bool PMSelectable::do_set_offSystem bool(PMSelectable::*  fnc_unset)(),
bool(PMSelectable::*  fnc_delete)()
[inline, private]
 

Request to adjust state so that the object won't be present on the targetSystem after install. Function pointers passed denote the modification level (user/appl/auto).

In other words: If the object is installed, set to delete. If it's not installed, unset it. If it already is_offSystem leave it as it is.

bool PMSelectable::do_set_onSystem bool(PMSelectable::*  fnc_unset)(),
bool(PMSelectable::*  fnc_install)()
[inline, private]
 

Request to adjust state so that the object will be present on the targetSystem after install. Function pointers passed denote the modification level (user/appl/auto).

In other words: If the object is set to delete, unset it (kepp the installed one). If it's not installed, set to install. If it already is_onSystem leave it as it is.

bool PMSelectable::downgrade_condition  )  const
 

Downgrade condition. Returns true, iff both objects are present, and installation of candidateObj would just replace or downgrade the installedObj. (except both packages are SuSE and the candidate has newer buildtime) Always false for non package objects!

ostream & PMSelectable::dumpOn std::ostream &  str  )  const [virtual]
 

Used by ostream::operator<< to print some debug lines

Reimplemented from CountedRep.

std::ostream & PMSelectable::dumpStateOn std::ostream &  str  )  const
 

print some debug lines

Fate PMSelectable::fate  )  const [inline]
 

bool PMSelectable::has_both_objects  )  const [inline]
 

True if installed and candidate object is present

bool PMSelectable::has_candidate  )  const [inline]
 

True if candidate object is present

bool PMSelectable::has_candidate_only  )  const [inline]
 

True if candidate object is present but no installed.

bool PMSelectable::has_installed  )  const [inline]
 

True if installed object is present

bool PMSelectable::has_installed_only  )  const [inline]
 

True if installed object is present but no candidate.

bool PMSelectable::has_object  )  const [inline]
 

True if either installed or candidate object is present

PMObjectPtr PMSelectable::installedObj  )  const [inline]
 

If not NULL, the Object actually installed on the target system.

Otherwise no Object with this name is currently installed on the target system.

bool PMSelectable::intern_set_status const UI_Status  state_r,
const bool  doit
[private]
 

Test or trigger status change according to doit.

bool PMSelectable::is_offSystem  )  const [inline]
 

Return true if the object won't be present on the targetSystem after install.

In other words: The object either is installed, but selected to delete, or is not installed and not selected to install.

bool PMSelectable::is_onSystem  )  const [inline]
 

Return true if the object will be present on the targetSystem after install.

In other words: The object either is installed, but not selected to delete, or is not installed but selected to install.

bool PMSelectable::is_taboo  )  const [inline]
 

True if no modification allowed by user.

bool PMSelectable::isEmpty  )  const [private]
 

const PkgName& PMSelectable::name  )  const [inline]
 

The common name of all Objects managed by this Selectable.

bool PMSelectable::providesSources  )  const
 

True if candidate object provides sources to install

PMSelectable::REP_BODY PMSelectable   )  [private]
 

bool PMSelectable::set_source_install const bool  install_r  ) 
 

Set whether to install available sources.

bool PMSelectable::set_status const UI_Status  state_r  ) 
 

If possible, trigger action according to state_r.

bool PMSelectable::setCandidateOrder PM::CandidateOrder  neworder_r  )  [static, private]
 

void PMSelectable::setInstalledObj PMObjectPtr  obj_r  )  [private]
 

void PMSelectable::setNothingSelected  )  [inline]
 

Set to neither install nor delete (keeps taboo)

bool PMSelectable::setUserCandidate const PMObjectPtr &  obj_r  ) 
 

Set the userCandidate().

bool PMSelectable::source_install  )  const [inline]
 

True if available sources would be installed.

PMSelectable::UI_Status PMSelectable::status  )  const
 

Return the current ui_status (no flags returned)

bool PMSelectable::test const constPMSelectablePtr &  sel_r,
Test_method  fnc_r
[inline, static]
 

Evaluates a Test_method

bool PMSelectable::test_set_status const UI_Status  state_r  )  [inline]
 

Test whether set_status(state_r) would succseed..

PMObjectPtr PMSelectable::theObject  )  const [inline]
 

UI likes to have one among the Objects refered to here, whichs data are shown per default.

Returns installedObj(). If not available candidateObj(). If not available one out of availableObjs().

bool PMSelectable::to_delete  )  const [inline]
 

True if to delete

bool PMSelectable::to_install  )  const [inline]
 

True if to install

bool PMSelectable::to_modify  )  const [inline]
 

True if either to delete or to install

bool PMSelectable::user_clr_taboo  )  [inline]
 

Clear taboo flag.

bool PMSelectable::user_set_delete  )  [inline]
 

User request to delete the installed object. Fails if no installed object is present (clears taboo).

bool PMSelectable::user_set_install  )  [inline]
 

User request to install the candidate object. Fails if no candidate object is present (clears taboo).

bool PMSelectable::user_set_offSystem  )  [inline]
 

do_set_offSystem requested by user.

bool PMSelectable::user_set_onSystem  )  [inline]
 

do_set_onSystem requested by user.

bool PMSelectable::user_set_taboo  )  [inline]
 

No modification allowed by user.

bool PMSelectable::user_unset  )  [inline]
 

User request to clear state (neither delete nor install). (keeps taboo)

PMObjectPtr PMSelectable::userCandidate  )  const [inline]
 

One among the availableObjs() explicitly requested by user.


Friends And Related Function Documentation

std::ostream& operator<< std::ostream &  str,
PMSelectable::UI_Status  obj
[friend]
 


Member Data Documentation

PMObjectList PMSelectable::_candidateList [private]
 

PMObjectPtr PMSelectable::_candidateObj [private]
 

PMSelectable::ClistCompare PMSelectable::_clistCompare = DEAFAULT_CLISTCOMPARE [static, private]
 

PMObjectPtr PMSelectable::_installedObj [private]
 

PMManager* PMSelectable::_manager [private]
 

PkgName PMSelectable::_name [private]
 

SelState PMSelectable::_state [private]
 

PMObjectPtr PMSelectable::_userCandidateObj [private]
 


The documentation for this class was generated from the following files:
Generated on Fri Nov 9 14:30:32 2007 for yast2-packagemanager by doxygen 1.3.6