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

InstSrcManager Class Reference

#include <InstSrcManager.h>

List of all members.

Public Types

typedef InstSrcError Error
typedef InstSrcError Error
typedef PM::ISrcId ISrcId
typedef PM::ISrcIdList ISrcIdList
typedef PM::SrcState SrcState
typedef PM::SrcStateVector SrcStateVector
typedef PM::InstOrder InstOrder

Public Member Functions

PMError scanMedia (ISrcIdList &idlist_r, const Url &mediaurl_r)
PMError scanMedia (ISrcId &isrc_r, const Url &mediaurl_r, const Pathname &product_dir_r)
PMError enableSource (const ISrcId &isrc_r)
PMError disableSource (const ISrcId &isrc_r)
PMError setAutoenable (const ISrcId isrc_r, const bool yesno)
PMError rankUp (const ISrcId isrc_r)
PMError rankDown (const ISrcId isrc_r)
PMError rankBehind (const ISrcId isrc_r, const ISrcId point_r)
PMError rankBefore (const ISrcId isrc_r, const ISrcId point_r)
PMError setNewRanks ()
PMError deleteSource (ISrcId &isrc_r)
PMError rewriteUrl (const ISrcId isrc_r, const Url &newUrl_r)
SrcStateVector editGet () const
PMError editSet (const SrcStateVector &keep_r)
unsigned knownSources () const
ISrcIdList getSources (const bool enabled_only=false) const
void getSources (ISrcIdList &idlist_r, const bool enabled_only=false) const
ISrcId getSourceByID (PM::NumericISrcID srcID_r) const
void disableAllSources ()
void enableDefaultSources ()
PMError releaseMedia (const ISrcId isrc_r, bool if_removable_r=false) const
PMError releaseAllMedia (bool if_removable_r=false) const
void preferredLocaleChanged () const
PMError cacheCopyTo (const Pathname &newRoot_r)
void setInstOrder (const InstOrder &newOrder_r)
void setDefaultInstOrder ()
const InstOrderinstOrder () const
ISrcIdList instOrderSources () const
int instOrderIndex (const ISrcId &isrc_r) const
PkgPubkeyCachepkgPubkeyCache ()

Static Public Attributes

const unsigned NO_RANK = unsigned(-1)

Private Types

typedef std::set< ProductEntryProductSet
typedef std::list< InstSrcPtr > ISrcPool

Private Member Functions

InstSrcManageroperator= (const InstSrcManager &)
 InstSrcManager (const InstSrcManager &)
 InstSrcManager (const bool autoEnable_r=true)
 ~InstSrcManager ()
Pathname cachePath (const Pathname &sub_r) const
Pathname cache_root_dir () const
Pathname cache_tmp_dir () const
Pathname cache_pubkey_dir () const
Pathname genSrcCacheName () const
PMError scanProductsFile (const Pathname &file_r, ProductSet &pset_r) const
PMError initSrcPool (const bool autoEnable_r)
PMError scanSrcCache (const Pathname &srccache_r)
PMError writeNewRanks ()
ISrcPool::iterator poolHandle (const ISrcId &isrc_r)
InstSrcPtr lookupId (const ISrcId &isrc_r) const
InstSrcPtr lookupSourceByID (PM::NumericISrcID srcID_r) const
ISrcId poolAdd (InstSrcPtr nsrc_r, bool rankcheck_r=true)
PMError activateSource (const InstSrcPtr &isrc_r, bool yesno_r)
PMError activateSource (const ISrcId &isrc_r, bool yesno_r)
PMError intern_cacheCopyTo ()

Private Attributes

ISrcPool _knownSources
bool _want_sources_enabled
InstOrder _instOrder
PkgPubkeyCache _pubkeyCache

Static Private Attributes

Pathname _cache_root_dir
const Pathname _cache_tmp_dir
const Pathname _cache_pubkey_dir

Friends

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


Member Typedef Documentation

typedef InstSrcError InstSrcManager::Error
 

default error class

typedef InstSrcError InstSrcManager::Error
 

default error class

typedef PM::InstOrder InstSrcManager::InstOrder
 

typedef PM::ISrcId InstSrcManager::ISrcId
 

typedef PM::ISrcIdList InstSrcManager::ISrcIdList
 

typedef std::list<InstSrcPtr> InstSrcManager::ISrcPool [private]
 

typedef std::set<ProductEntry> InstSrcManager::ProductSet [private]
 

typedef PM::SrcState InstSrcManager::SrcState
 

typedef PM::SrcStateVector InstSrcManager::SrcStateVector
 


Constructor & Destructor Documentation

InstSrcManager::InstSrcManager const InstSrcManager  )  [private]
 

InstSrcManager::InstSrcManager const bool  autoEnable_r = true  )  [private]
 

InstSrcManager::~InstSrcManager  )  [private]
 


Member Function Documentation

PMError InstSrcManager::activateSource const ISrcId isrc_r,
bool  yesno_r
[private]
 

Enable/disable isrc_r according to yesno_r.

PMError InstSrcManager::activateSource const InstSrcPtr &  isrc_r,
bool  yesno_r
[private]
 

Enable/disable isrc_r according to yesno_r.

Pathname InstSrcManager::cache_pubkey_dir  )  const [inline, private]
 

Full path of cache_pubkey_dir

Pathname InstSrcManager::cache_root_dir  )  const [inline, private]
 

Full path of cache_root_dir

Pathname InstSrcManager::cache_tmp_dir  )  const [inline, private]
 

Full path of cache_tmp_dir (for downloads, etc.)

PMError InstSrcManager::cacheCopyTo const Pathname newRoot_r  ) 
 

Used during installation/Upadte (where caching is disabled) to install the caches on the system. So InstSrc'es will be available in the running system after boot.

Pathname InstSrcManager::cachePath const Pathname sub_r  )  const [inline, private]
 

Helper function to combine _cache_root_dir and subpaths.

PMError InstSrcManager::deleteSource ISrcId isrc_r  ) 
 

Delete InstSrc. Erase it together with all cached info.

Note: The ISrcId passed will be set to NULL. It should be the last ISrcId remembered somewhere. Otherwise deletion is delayed untill all autstanding references were cleared.

void InstSrcManager::disableAllSources  ) 
 

Disable all InstSrc'es.

PMError InstSrcManager::disableSource const ISrcId isrc_r  )  [inline]
 

Disable InstSrc. Provided Objects are withdrawn from Manager classes.

InstSrcManager::SrcStateVector InstSrcManager::editGet  )  const
 

Return list of all known sources numeric srcID and default state (as pair). the list is sorted in priority order (highest first).

PMError InstSrcManager::editSet const SrcStateVector keep_r  ) 
 

Rearange known InstSrces rank and default state according to keep_r (highest priority first). Known sources not mentioned in keep_r are deleted.

void InstSrcManager::enableDefaultSources  ) 
 

Enable/disable all InstSrc'es according to their default state (see setAutoenable).

PMError InstSrcManager::enableSource const ISrcId isrc_r  )  [inline]
 

Enable InstSrc. Let it provide it's Objects to the Manager classes.

Pathname InstSrcManager::genSrcCacheName  )  const [private]
 

Return a new (not existing) directory name in cache_root_dir

ISrcId InstSrcManager::getSourceByID PM::NumericISrcID  srcID_r  )  const [inline]
 

Convert the numeric srcID back to an ISrcId.

As an ISrcId basically is a 'constInstSrcPtr', it may get reused by deleting and creating InstSrc'es. Besides this an ISrcId keeps an open reference to the InstSrc. So they are not intended to be stored longer than necessary.

Rut each InstSrc owns a unique numeric ID, which may be retrieved by calling InstSrc::srcID. Providing this srcID, the coresponding ISrcId is returned, or NULL, if the InstSrc not found in the list of known InstSrces (e.g. meanwhile deleted).

void InstSrcManager::getSources ISrcIdList idlist_r,
const bool  enabled_only = false
const [inline]
 

Return the ISrcId's of all known InstSrces. Or enabled InsrSrces only, if enabled_only == true.

TODO: Should be replaced by some Iterator.

InstSrcManager::ISrcIdList InstSrcManager::getSources const bool  enabled_only = false  )  const
 

Return the ISrcId's of all known InstSrces. Or enabled InsrSrces only, if enabled_only == true.

TODO: Should be replaced by some Iterator.

PMError InstSrcManager::initSrcPool const bool  autoEnable_r  )  [private]
 

Preload all cached InstSrces.

const InstOrder& InstSrcManager::instOrder  )  const [inline]
 

Return the current InstOrder.

int InstSrcManager::instOrderIndex const ISrcId isrc_r  )  const
 

Return the index [0..n] of isrc_r in instOrderSources, or -1 if isrc_r is not enabled or NULL.

InstSrcManager::ISrcIdList InstSrcManager::instOrderSources  )  const
 

Return the ISrcId's of all enabled InstSrces in install order. The default install order is sorted by rank, thus the same as returned by getSources(true). See setInstOrder.

PMError InstSrcManager::intern_cacheCopyTo  )  [private]
 

helper for cacheCopyTo fake

unsigned InstSrcManager::knownSources  )  const [inline]
 

Return the number of known InstSrc'es.

InstSrcPtr InstSrcManager::lookupId const ISrcId isrc_r  )  const [private]
 

Find InstSrcPtr in _knownSources by ISrcId. Return NULL if not in _knownSources.

InstSrcPtr InstSrcManager::lookupSourceByID PM::NumericISrcID  srcID_r  )  const [private]
 

Find InstSrcPtr in _knownSources by numeric srcID. Return NULL if not in _knownSources.

InstSrcManager& InstSrcManager::operator= const InstSrcManager  )  [private]
 

PkgPubkeyCache& InstSrcManager::pkgPubkeyCache  )  [inline]
 

InstSrcManager::ISrcId InstSrcManager::poolAdd InstSrcPtr  nsrc_r,
bool  rankcheck_r = true
[private]
 

Add nsrc_r to _knownSources if same product is not yet present. Return ISrcId for the added nsrc_r, or NULL if duplicate.

If nsrc has no rank assigned, it gets least priority.

Note:</> If norankcheck_r is true, ranks are not checked, and added sources are not attached to the InstSrcManager. This is to be used by initSrcPool/scanSrcCache at startup only! They take care of ranking and attaching after all cached sources were loaded.

InstSrcManager::ISrcPool::iterator InstSrcManager::poolHandle const ISrcId isrc_r  )  [private]
 

Return _knownSources iterator to ISrcId. Return _knownSources.end() if not in _knownSources.

void InstSrcManager::preferredLocaleChanged  )  const
 

Trigger change of preferredLocale. Propagated to all known InstSrces.

PMError InstSrcManager::rankBefore const ISrcId  isrc_r,
const ISrcId  point_r
 

Adjust isrc priority to be directly before point. If point is NULL it will get highest priority.

PMError InstSrcManager::rankBehind const ISrcId  isrc_r,
const ISrcId  point_r
 

Adjust isrc priority to be directly behind point. If point is NULL it will get least priority.

PMError InstSrcManager::rankDown const ISrcId  isrc_r  ) 
 

Lower priority by one

PMError InstSrcManager::rankUp const ISrcId  isrc_r  ) 
 

Raise priority by one

PMError InstSrcManager::releaseAllMedia bool  if_removable_r = false  )  const
 

Let all InstSrc'es release their media. if_removable is true: release if CD/DVD only.

PMError InstSrcManager::releaseMedia const ISrcId  isrc_r,
bool  if_removable_r = false
const
 

Let a certain InstSrc release it's media. if_removable is true: release if CD/DVD only.

Returns:
Error returned by InstSrc::releaseMedia

PMError InstSrcManager::rewriteUrl const ISrcId  isrc_r,
const Url newUrl_r
 

Set new Url for InstSrc.

PMError InstSrcManager::scanMedia ISrcId isrc_r,
const Url mediaurl_r,
const Pathname product_dir_r
 

Load a certain InstSrc located on mediaurl in product_dir.

This is what the above scanMedia function calls, for each product found in a /media.1/products file.

PMError InstSrcManager::scanMedia ISrcIdList idlist_r,
const Url mediaurl_r
 

Access media. Detect kind of InstSrc(es) available on media by scanning /media.1/products if available. Otherwise assume the InstSrc is located directly below mediaurl.

Load the InstSrc(es) (add them to ISrcPool).

PMError InstSrcManager::scanProductsFile const Pathname file_r,
ProductSet pset_r
const [private]
 

PMError InstSrcManager::scanSrcCache const Pathname srccache_r  )  [private]
 

Create InstSrc from cache and add it to ISrcPool.

PMError InstSrcManager::setAutoenable const ISrcId  isrc_r,
const bool  yesno
 

Set whether this source should be automaticaly enabled on startup.

Note that this is something different, than calling enableSource/disableSource. setAutoenable determines the desired state of an InstSrc when the InstSrcManager is started (auto enable it or not). enableSource/disableSource actually enabale/disable an InstSrc (i.e. let it provide/withdraw Objects).

void InstSrcManager::setDefaultInstOrder  ) 
 

The default install order is sorted by rank, thus the same as returned by getSources(true).

void InstSrcManager::setInstOrder const InstOrder newOrder_r  ) 
 

Explicitly set an install order.

orderedSrcID_r is expected to contain valid numeric InstSrc IDs (see getSourceByID). instOrderSources will then put all enabled InstSrces according to orderedSrcID_r in front of the list. Enabled InstSrces not mentioned in orderedSrcID_r will be appended in default order.

PMError InstSrcManager::setNewRanks  ) 
 

To be called by InstSrc Editor to write the current ranking to disk.

PMError InstSrcManager::writeNewRanks  )  [private]
 

Rewrite rank values of all known sources. Used by initSrcPool.


Friends And Related Function Documentation

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


Member Data Documentation

const Pathname InstSrcManager::_cache_pubkey_dir [static, private]
 

Subpath (below _cache_root_dir) for gpg-pubkeys.

Pathname InstSrcManager::_cache_root_dir [static, private]
 

Cachedir to use.

const Pathname InstSrcManager::_cache_tmp_dir [static, private]
 

Subpath (below _cache_root_dir) for InstSrcManager downloads.

InstOrder InstSrcManager::_instOrder [private]
 

ISrcPool InstSrcManager::_knownSources [private]
 

PkgPubkeyCache InstSrcManager::_pubkeyCache [private]
 

bool InstSrcManager::_want_sources_enabled [private]
 

Turned on at startup or by enableDefaultSources, turned off by disableAllSources. Evaluated by editSet to see whether the sources should be activated, or stay as they are.

const unsigned InstSrcManager::NO_RANK = unsigned(-1) [static]
 


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