libzypp 17.37.17
context.cc
Go to the documentation of this file.
1/*---------------------------------------------------------------------\
2| ____ _ __ __ ___ |
3| |__ / \ / / . \ . \ |
4| / / \ V /| _/ _/ |
5| / /__ | | | | | | |
6| /_____||_| |_| |_| |
7| |
8\---------------------------------------------------------------------*/
9#include "private/context_p.h"
10#include <zypp/ZYppFactory.h>
12#include <zypp-core/zyppng/base/EventLoop>
13#include <zypp-media/ng/Provide>
14
15namespace zyppng {
16
18
20 : UserInterface( *new ContextPrivate( *this ) )
21 {
22 Z_D();
23 d->_zyppPtr = zypp::getZYpp();
24 d->_eventDispatcher = ThreadData::current().ensureDispatcher();
25
26 d->_provider = Provide::create( d->_providerDir );
27
28 // @TODO should start be implicit as soon as something is enqueued?
29 d->_provider->start();
30 }
31
32 ProvideRef Context::provider() const
33 {
34 Z_D();
35 return d->_provider;
36 }
37
39 {
40 return d_func()->_zyppPtr->keyRing();
41 }
42
47
52
57
62
63 void Context::executeImpl(const AsyncOpBaseRef& op)
64 {
65 auto loop = EventLoop::create();
66 op->sigReady().connect([&](){
67 loop->quit();
68 });
69 loop->run();
70 return;
71 }
72}
ResPool::instance().proxy();.
Global ResObject pool.
Definition ResPool.h:62
static ResPool instance()
Singleton ctor.
Definition ResPool.cc:38
ResPoolProxy proxy() const
preliminary
Definition ResPool.cc:59
Interim helper class to collect global options and settings.
Definition ZConfig.h:69
static ZConfig & instance()
Singleton ctor.
Definition ZConfig.cc:940
ZYpp::Ptr getZYpp()
Convenience to get the Pointer to the ZYpp instance.
Definition ZYppFactory.h:77
Global sat-pool.
Definition Pool.h:47
static Pool instance()
Singleton ctor.
Definition Pool.h:55
zypp::ZConfig & config()
Definition context.cc:43
void executeImpl(const AsyncOpBaseRef &op)
Definition context.cc:63
ProvideRef provider() const
Definition context.cc:32
zypp::ResPool pool()
Access to the resolvable pool.
Definition context.cc:48
zypp::sat::Pool satPool()
Access to the sat pool.
Definition context.cc:58
zypp::ResPoolProxy poolProxy()
Pool of ui::Selectable.
Definition context.cc:53
KeyRingRef keyRing() const
Definition context.cc:38
static Ptr create()
static ProvideRef create(const zypp::Pathname &workDir="")
Definition provide.cc:1005
ZYPP_IMPL_PRIVATE_CONSTR(Context)
Definition context.cc:19
zypp::KeyRing_Ptr KeyRingRef
Definition context.h:29
static ZYPP_API ThreadData & current()
Definition threaddata.cc:16
std::shared_ptr< EventDispatcher > ensureDispatcher()
Definition threaddata.cc:32
#define ZYPP_IMPL_PRIVATE(Class)
Definition zyppglobal.h:92
#define Z_D()
Definition zyppglobal.h:105