zypp::cache::CacheTypes Class Reference

Cache types is a class that reads the dynamic types from the cache, and keeps them on memory. More...

#include <CacheTypes.h>

List of all members.

Public Member Functions

 CacheTypes (const Pathname &dbdir)
 Default ctor.
 ~CacheTypes ()
 Dtor.
Rel relationFor (const data::RecordId &id)
 Relation for a cache record id.
data::RecordId idForRelation (const Rel &rel)
 Cache record id for Relation.
Resolvable::Kind kindFor (const data::RecordId &id)
 Kind for a cache record id.
data::RecordId idForKind (const Resolvable::Kind &kind)
 Cache record id for Kind.
Dep deptypeFor (const data::RecordId &id)
 Dependency type for a cache record id.
data::RecordId idForDeptype (const Dep &dep)
 Cache record id for Dep type.
Arch archFor (const data::RecordId &id)
 Architecture for a cache record id.
data::RecordId idForArch (const Arch &arch)
 Cache record id for Arch.

Private Member Functions

void refreshCache ()

Private Attributes

std::map
< data::RecordId,
Rel
_rel_cache
std::map
< data::RecordId,
Resolvable::Kind
_kind_cache
std::map
< data::RecordId,
std::string > 
_deptype_cache
std::map
< data::RecordId,
Arch
_arch_cache
Pathname _dbdir

Friends

std::ostream & operator<< (std::ostream &str, const CacheTypes &obj)
 Stream output.


Detailed Description

Cache types is a class that reads the dynamic types from the cache, and keeps them on memory.

Then it can by asked for the type for an Id.

See also:
CacheStore::lookupOrAppendType

Definition at line 45 of file CacheTypes.h.


Constructor & Destructor Documentation

zypp::cache::CacheTypes::CacheTypes ( const Pathname &  dbdir  ) 

Default ctor.

Parameters:
dbdir Path where the cache is located.

Definition at line 40 of file CacheTypes.cc.

References refreshCache().

zypp::cache::CacheTypes::~CacheTypes (  ) 

Dtor.

Definition at line 185 of file CacheTypes.cc.


Member Function Documentation

Rel zypp::cache::CacheTypes::relationFor ( const data::RecordId id  ) 

Relation for a cache record id.

Parameters:
id The id you got in a cache query
Exceptions:
Exception if the id is not a valid type

Definition at line 84 of file CacheTypes.cc.

References _rel_cache, and ZYPP_THROW.

data::RecordId zypp::cache::CacheTypes::idForRelation ( const Rel rel  ) 

Cache record id for Relation.

Parameters:
rel relation
Exceptions:
Exception if the Relation is not valid

Definition at line 97 of file CacheTypes.cc.

References _rel_cache, and ZYPP_THROW.

Resolvable::Kind zypp::cache::CacheTypes::kindFor ( const data::RecordId id  ) 

Kind for a cache record id.

Parameters:
id The id you got in a cache query
Exceptions:
Exception if the id is not a valid type

Definition at line 108 of file CacheTypes.cc.

References _kind_cache, and ZYPP_THROW.

Referenced by zypp::repo::cached::RepoImpl::createResolvables(), and zypp::cache::ResolvableQuery::Impl::fromRow().

data::RecordId zypp::cache::CacheTypes::idForKind ( const Resolvable::Kind kind  ) 

Cache record id for Kind.

Parameters:
kind Kind
Exceptions:
Exception if the Kind is not valid

Definition at line 120 of file CacheTypes.cc.

References _kind_cache, and ZYPP_THROW.

Referenced by zypp::cache::ResolvableQuery::Impl::iterateResolvablesByKindsAndStringsAndRepos().

Dep zypp::cache::CacheTypes::deptypeFor ( const data::RecordId id  ) 

Dependency type for a cache record id.

Parameters:
id The id you got in a cache query
Exceptions:
Exception if the id is not a valid type

Definition at line 131 of file CacheTypes.cc.

References _deptype_cache, ERR, and ZYPP_THROW.

data::RecordId zypp::cache::CacheTypes::idForDeptype ( const Dep dep  ) 

Cache record id for Dep type.

Parameters:
dep Dep
Exceptions:
Exception if the Dep is not valid

Definition at line 143 of file CacheTypes.cc.

References _deptype_cache, zypp::Dep::asString(), and ZYPP_THROW.

Arch zypp::cache::CacheTypes::archFor ( const data::RecordId id  ) 

Architecture for a cache record id.

Parameters:
id The id you got in a cache query
Exceptions:
Exception if the id is not a valid type

Definition at line 154 of file CacheTypes.cc.

References _arch_cache, and ZYPP_THROW.

Referenced by zypp::repo::cached::RepoImpl::createPatchAndDeltas(), zypp::repo::cached::RepoImpl::createResolvables(), and zypp::cache::ResolvableQuery::Impl::fromRow().

data::RecordId zypp::cache::CacheTypes::idForArch ( const Arch arch  ) 

Cache record id for Arch.

Parameters:
arch Arch
Exceptions:
Exception if the Arch is not valid

Definition at line 167 of file CacheTypes.cc.

References _arch_cache, and ZYPP_THROW.

void zypp::cache::CacheTypes::refreshCache (  )  [private]

Definition at line 46 of file CacheTypes.cc.

References _arch_cache, _dbdir, _deptype_cache, _kind_cache, _rel_cache, zypp::ui::asString(), sqlite3x::sqlite3_connection::executenonquery(), sqlite3x::sqlite3_command::executereader(), sqlite3x::sqlite3_reader::getint64(), sqlite3x::sqlite3_reader::getstring(), MIL, name, sqlite3x::sqlite3_reader::read(), and ZYPP_THROW.

Referenced by CacheTypes().


Friends And Related Function Documentation

std::ostream & operator<< ( std::ostream &  str,
const CacheTypes obj 
) [friend]

Stream output.

Definition at line 193 of file CacheTypes.cc.


Member Data Documentation

std::map<data::RecordId, Rel> zypp::cache::CacheTypes::_rel_cache [private]

Definition at line 137 of file CacheTypes.h.

Referenced by idForRelation(), refreshCache(), and relationFor().

std::map<data::RecordId, Resolvable::Kind> zypp::cache::CacheTypes::_kind_cache [private]

Definition at line 138 of file CacheTypes.h.

Referenced by idForKind(), kindFor(), and refreshCache().

std::map<data::RecordId, std::string> zypp::cache::CacheTypes::_deptype_cache [private]

Definition at line 139 of file CacheTypes.h.

Referenced by deptypeFor(), idForDeptype(), and refreshCache().

std::map<data::RecordId, Arch> zypp::cache::CacheTypes::_arch_cache [private]

Definition at line 140 of file CacheTypes.h.

Referenced by archFor(), idForArch(), and refreshCache().

Pathname zypp::cache::CacheTypes::_dbdir [private]

Definition at line 141 of file CacheTypes.h.

Referenced by refreshCache().


The documentation for this class was generated from the following files:
Generated on Tue Sep 25 19:23:18 2007 for libzypp by  doxygen 1.5.3