zypp::Source_Ref Class Reference

#include <Source.h>

Inheritance diagram for zypp::Source_Ref:

zypp::base::SafeBool< Source_Ref > zypp::base::safebool_detail::SafeBoolBase List of all members.

Public Types

typedef source::SourceImpl Impl
typedef source::SourceImpl_Ptr Impl_Ptr
typedef unsigned long NumericId

Public Member Functions

 Source_Ref ()
 Default ctor: noSource.
NumericId numericId () const
 Runtime unique numeric Source Id.
Date timestamp () const
 aproximate age of the source, can be used to determine if the source needs to be read again or not.
bool resStoreInitialized () const
 Whether the ResStore is initialized.
const ResStoreresolvables () const
 All resolvables provided by this source.
const ResStore resolvables (zypp::Resolvable::Kind kind) const
 All resolvables of a given kind provided by this source.
const Pathname providePackage (Package::constPtr package)
const Pathname provideFile (const Pathname &file_r, const unsigned media_nr=1)
 Provide a file to local filesystem.
const Pathname provideDirTree (const Pathname &dir_r, const unsigned media_nr=1)
const void releaseFile (const Pathname &file_r, const unsigned media_nr=1)
const void releaseDir (const Pathname &dir_r, const unsigned media_nr=1, const bool recursive=false)
const bool enabled () const
void enable ()
void disable ()
const bool autorefresh () const
void setAutorefresh (const bool enable_r)
void refresh ()
void storeMetadata (const Pathname &cache_dir_r)
std::string alias (void) const
 also for ZMD
void setAlias (const std::string &alias_r)
std::string type (void) const
 string description of the source type, e.g. "YUM" or "YaST"
unsigned numberOfMedia (void) const
std::string vendor (void) const
 from media.1/media
std::string unique_id (void) const
 from media.1/media
void changeMedia (const media::MediaId &media_r, const Pathname &path_r)
 Change the media of the source (in case original media is not available) The media must be ready-to-use (in the same form as when passing to SourceImpl constructor).
void redirect (unsigned media_nr, const Url &new_url)
 Redirect the given media to the given URL instead of the standard one.
void release ()
 Release all medias attached by the source.
void reattach (const Pathname &attach_point)
 Reattach the source if it is not mounted, but downloaded, to different directory.
media::MediaVerifierRef verifier (unsigned media_nr)
 Provide a media verifier suitable for the given media number.
generic information get/set
std::string id (void) const
 runtime-unique, not persistent, a "handle" for Pkg::, string?!
void setId (const std::string id_r)
unsigned priority (void) const
void setPriority (unsigned p)
unsigned priorityUnsubscribed (void) const
void setPriorityUnsubscribed (unsigned p)
bool subscribed (void) const
void setSubscribed (bool s)
const PathnamecacheDir (void) const
const std::list< PathnamepublicKeys ()
for ZMD
std::string zmdName (void) const
void setZmdName (const std::string name_r)
std::string zmdDescription (void) const
void setZmdDescription (const std::string desc_r)
for YaST
Url url (void) const
void setUrl (const Url &url)
 required for the parse-metadata helper of libzypp-zmd-backend which gets local files to parse but the source is really remote.
bool remote () const
const Pathnamepath (void) const
const bool baseSource () const

Static Public Attributes

static const Source_Ref noSource
 A dummy Source (Id 0) providing nothing, doing nothing.

Private Member Functions

friend base::SafeBool () const
bool boolTest () const
 SafeBool test.
 Source_Ref (const Impl_Ptr &impl_r)
 Factory ctor.

Private Attributes

Impl_Ptr _pimpl
 Pointer to implementation.

Friends

class SourceFactory
 Factory.
class source::SourceImpl
std::ostream & operator<< (std::ostream &str, const Source_Ref &obj)
bool operator== (const Source_Ref &lhs, const Source_Ref &rhs)
bool operator< (const Source_Ref &lhs, const Source_Ref &rhs)

Related Functions

(Note that these are not member functions.)

bool operator!= (const Source_Ref &lhs, const Source_Ref &rhs)

Detailed Description

Note:
Source is a reference to the implementation. No COW is performed.

Definition at line 60 of file Source.h.


Member Typedef Documentation

typedef source::SourceImpl zypp::Source_Ref::Impl
 

Definition at line 67 of file Source.h.

typedef source::SourceImpl_Ptr zypp::Source_Ref::Impl_Ptr
 

Definition at line 68 of file Source.h.

typedef unsigned long zypp::Source_Ref::NumericId
 

Definition at line 88 of file Source.h.


Constructor & Destructor Documentation

zypp::Source_Ref::Source_Ref  ) 
 

Default ctor: noSource.

Real Sources are to be created via SourceFactory.

Definition at line 33 of file Source.cc.

zypp::Source_Ref::Source_Ref const Impl_Ptr impl_r  )  [explicit, private]
 

Factory ctor.

Definition at line 42 of file Source.cc.


Member Function Documentation

Source_Ref::NumericId zypp::Source_Ref::numericId  )  const
 

Runtime unique numeric Source Id.

Definition at line 54 of file Source.cc.

References _pimpl.

Referenced by zypp::ResObject::dumpOn(), and zypp::sourceTableAdd().

Date zypp::Source_Ref::timestamp  )  const
 

aproximate age of the source, can be used to determine if the source needs to be read again or not.

(read as parse its metadata, not about downloading)

Definition at line 95 of file Source.cc.

References _pimpl.

bool zypp::Source_Ref::resStoreInitialized  )  const
 

Whether the ResStore is initialized.

If we know that noone has seen the resolvables yet, we can skip them too, eg. when deleting a source. (#174840)

Definition at line 57 of file Source.cc.

References _pimpl.

const ResStore & zypp::Source_Ref::resolvables  )  const
 

All resolvables provided by this source.

Definition at line 60 of file Source.cc.

References _pimpl.

const ResStore zypp::Source_Ref::resolvables zypp::Resolvable::Kind  kind  )  const
 

All resolvables of a given kind provided by this source.

Definition at line 63 of file Source.cc.

References _pimpl.

const Pathname zypp::Source_Ref::providePackage Package::constPtr  package  ) 
 

Definition at line 74 of file Source.cc.

References _pimpl.

const Pathname zypp::Source_Ref::provideFile const Pathname file_r,
const unsigned  media_nr = 1
 

Provide a file to local filesystem.

Definition at line 66 of file Source.cc.

References _pimpl.

Referenced by zypp::source::yum::YUMScriptImpl::do_script(), and zypp::source::yum::YUMScriptImpl::undo_script().

const Pathname zypp::Source_Ref::provideDirTree const Pathname dir_r,
const unsigned  media_nr = 1
 

Definition at line 70 of file Source.cc.

References _pimpl.

const void zypp::Source_Ref::releaseFile const Pathname file_r,
const unsigned  media_nr = 1
 

Definition at line 77 of file Source.cc.

References _pimpl.

const void zypp::Source_Ref::releaseDir const Pathname dir_r,
const unsigned  media_nr = 1,
const bool  recursive = false
 

Definition at line 81 of file Source.cc.

References _pimpl.

const bool zypp::Source_Ref::enabled  )  const
 

Definition at line 86 of file Source.cc.

References _pimpl.

void zypp::Source_Ref::enable  ) 
 

Definition at line 89 of file Source.cc.

References _pimpl.

void zypp::Source_Ref::disable  ) 
 

Definition at line 92 of file Source.cc.

References _pimpl.

const bool zypp::Source_Ref::autorefresh  )  const
 

Definition at line 98 of file Source.cc.

References _pimpl.

void zypp::Source_Ref::setAutorefresh const bool  enable_r  ) 
 

Definition at line 101 of file Source.cc.

References _pimpl.

void zypp::Source_Ref::refresh  ) 
 

Definition at line 104 of file Source.cc.

References _pimpl.

void zypp::Source_Ref::storeMetadata const Pathname cache_dir_r  ) 
 

Definition at line 107 of file Source.cc.

References _pimpl.

Referenced by zypp::SourceCache::storeSource().

string zypp::Source_Ref::alias void   )  const
 

also for ZMD

Definition at line 110 of file Source.cc.

References _pimpl.

Referenced by zypp::source::susetags::ProductMetadataParser::parse(), zypp::source::susetags::parsePackages(), zypp::source::susetags::parseSelection(), and zypp::SourceCache::storeSource().

void zypp::Source_Ref::setAlias const std::string &  alias_r  ) 
 

Definition at line 113 of file Source.cc.

References _pimpl.

string zypp::Source_Ref::type void   )  const
 

string description of the source type, e.g. "YUM" or "YaST"

Definition at line 116 of file Source.cc.

References _pimpl.

unsigned zypp::Source_Ref::numberOfMedia void   )  const
 

Definition at line 188 of file Source.cc.

References _pimpl.

std::string zypp::Source_Ref::vendor void   )  const
 

from media.1/media

Definition at line 191 of file Source.cc.

References _pimpl.

Referenced by zypp::source::susetags::SuseTagsPackageImpl::vendor().

std::string zypp::Source_Ref::unique_id void   )  const
 

from media.1/media

Definition at line 197 of file Source.cc.

References _pimpl.

string zypp::Source_Ref::id void   )  const
 

runtime-unique, not persistent, a "handle" for Pkg::, string?!

Definition at line 119 of file Source.cc.

References _pimpl.

void zypp::Source_Ref::setId const std::string  id_r  ) 
 

Definition at line 122 of file Source.cc.

References _pimpl.

unsigned zypp::Source_Ref::priority void   )  const
 

Definition at line 137 of file Source.cc.

References _pimpl.

Referenced by zypp::solver::detail::ResolverQueue::copy_queue_except_for_branch(), and zypp::solver::detail::ResolverContext::getSourcePriority().

void zypp::Source_Ref::setPriority unsigned  p  ) 
 

Definition at line 140 of file Source.cc.

References _pimpl.

unsigned zypp::Source_Ref::priorityUnsubscribed void   )  const
 

Definition at line 143 of file Source.cc.

References _pimpl.

Referenced by zypp::solver::detail::ResolverContext::getSourcePriority().

void zypp::Source_Ref::setPriorityUnsubscribed unsigned  p  ) 
 

Definition at line 146 of file Source.cc.

References _pimpl.

bool zypp::Source_Ref::subscribed void   )  const
 

Definition at line 149 of file Source.cc.

References _pimpl.

Referenced by zypp::solver::detail::ResolverContext::getSourcePriority().

void zypp::Source_Ref::setSubscribed bool  s  ) 
 

Definition at line 152 of file Source.cc.

References _pimpl.

const Pathname & zypp::Source_Ref::cacheDir void   )  const
 

Definition at line 170 of file Source.cc.

References _pimpl.

const std::list< Pathname > zypp::Source_Ref::publicKeys  ) 
 

Definition at line 194 of file Source.cc.

References _pimpl.

string zypp::Source_Ref::zmdName void   )  const
 

Definition at line 125 of file Source.cc.

References _pimpl.

void zypp::Source_Ref::setZmdName const std::string  name_r  ) 
 

Definition at line 128 of file Source.cc.

References _pimpl.

string zypp::Source_Ref::zmdDescription void   )  const
 

Definition at line 131 of file Source.cc.

References _pimpl.

void zypp::Source_Ref::setZmdDescription const std::string  desc_r  ) 
 

Definition at line 134 of file Source.cc.

References _pimpl.

Url zypp::Source_Ref::url void   )  const
 

Definition at line 155 of file Source.cc.

References _pimpl.

Referenced by zypp::source::susetags::ProductMetadataParser::parse(), zypp::source::susetags::parsePackages(), zypp::source::susetags::parseSelection(), setUrl(), and zypp::SourceCache::storeSource().

void zypp::Source_Ref::setUrl const Url url  ) 
 

required for the parse-metadata helper of libzypp-zmd-backend which gets local files to parse but the source is really remote.

Definition at line 158 of file Source.cc.

References _pimpl, and url().

bool zypp::Source_Ref::remote  )  const
 

Definition at line 161 of file Source.cc.

References _pimpl.

const Pathname & zypp::Source_Ref::path void   )  const
 

Definition at line 164 of file Source.cc.

References _pimpl.

Referenced by zypp::SourceCache::storeSource().

const bool zypp::Source_Ref::baseSource  )  const
 

Definition at line 167 of file Source.cc.

References _pimpl.

Referenced by zypp::source::yum::YUMProductImpl::YUMProductImpl().

void zypp::Source_Ref::changeMedia const media::MediaId media_r,
const Pathname path_r
 

Change the media of the source (in case original media is not available) The media must be ready-to-use (in the same form as when passing to SourceImpl constructor).

Definition at line 173 of file Source.cc.

References _pimpl.

void zypp::Source_Ref::redirect unsigned  media_nr,
const Url new_url
 

Redirect the given media to the given URL instead of the standard one.

Definition at line 176 of file Source.cc.

References _pimpl.

void zypp::Source_Ref::release  ) 
 

Release all medias attached by the source.

Definition at line 179 of file Source.cc.

References _pimpl.

void zypp::Source_Ref::reattach const Pathname attach_point  ) 
 

Reattach the source if it is not mounted, but downloaded, to different directory.

Exceptions:
Exception 

Definition at line 182 of file Source.cc.

References _pimpl.

media::MediaVerifierRef zypp::Source_Ref::verifier unsigned  media_nr  ) 
 

Provide a media verifier suitable for the given media number.

Definition at line 185 of file Source.cc.

References _pimpl.

zypp::Source_Ref::base::SafeBool  )  const [private]
 

bool zypp::Source_Ref::boolTest  )  const [inline, private]
 

SafeBool test.

Definition at line 223 of file Source.h.

References _pimpl, and noSource.


Friends And Related Function Documentation

friend class SourceFactory [friend]
 

Factory.

Definition at line 228 of file Source.h.

friend class source::SourceImpl [friend]
 

Definition at line 229 of file Source.h.

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

Definition at line 205 of file Source.cc.

bool operator== const Source_Ref lhs,
const Source_Ref rhs
[friend]
 

Equal if same implementation class.

Definition at line 246 of file Source.h.

bool operator< const Source_Ref lhs,
const Source_Ref rhs
[friend]
 

Order in std::conainer based on _pimpl.

Definition at line 254 of file Source.h.

bool operator!= const Source_Ref lhs,
const Source_Ref rhs
[related]
 

Definition at line 250 of file Source.h.


Member Data Documentation

const Source_Ref zypp::Source_Ref::noSource [static]
 

A dummy Source (Id 0) providing nothing, doing nothing.

Todo:
provide a _constRef

Definition at line 80 of file Source.h.

Referenced by boolTest(), zypp::solver::detail::ResolverContext::collectCompareInfo(), zypp::SourceFactory::createFrom(), and zypp::detail::ResObjectImplIf::source().

Impl_Ptr zypp::Source_Ref::_pimpl [private]
 

Pointer to implementation.

Definition at line 238 of file Source.h.

Referenced by alias(), autorefresh(), baseSource(), boolTest(), cacheDir(), changeMedia(), disable(), enable(), enabled(), id(), numberOfMedia(), numericId(), zypp::operator<<(), path(), priority(), priorityUnsubscribed(), provideDirTree(), provideFile(), providePackage(), publicKeys(), reattach(), redirect(), refresh(), release(), releaseDir(), releaseFile(), remote(), resolvables(), resStoreInitialized(), setAlias(), setAutorefresh(), setId(), setPriority(), setPriorityUnsubscribed(), setSubscribed(), setUrl(), setZmdDescription(), setZmdName(), storeMetadata(), subscribed(), timestamp(), type(), unique_id(), url(), vendor(), verifier(), zmdDescription(), and zmdName().


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