#include <CacheTypes.h>
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. | |
Then it can by asked for the type for an Id.
Definition at line 45 of file CacheTypes.h.
| zypp::cache::CacheTypes::CacheTypes | ( | const Pathname & | dbdir | ) |
Default ctor.
| dbdir | Path where the cache is located. |
Definition at line 40 of file CacheTypes.cc.
References refreshCache().
| zypp::cache::CacheTypes::~CacheTypes | ( | ) |
| Rel zypp::cache::CacheTypes::relationFor | ( | const data::RecordId & | id | ) |
Relation for a cache record id.
| id | The id you got in a cache query |
| 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.
| rel | relation |
| 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.
| id | The id you got in a cache query |
| 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.
| kind | Kind |
| 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.
| id | The id you got in a cache query |
| 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.
| dep | Dep |
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.
| id | The id you got in a cache query |
| 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.
| arch | Arch |
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().
| std::ostream & operator<< | ( | std::ostream & | str, | |
| const CacheTypes & | obj | |||
| ) | [friend] |
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] |
1.5.3