libzypp  17.32.4
context.h
Go to the documentation of this file.
1 /*---------------------------------------------------------------------\
2 | ____ _ __ __ ___ |
3 | |__ / \ / / . \ . \ |
4 | / / \ V /| _/ _/ |
5 | / /__ | | | | | | |
6 | /_____||_| |_| |_| |
7 | |
8 \---------------------------------------------------------------------*/
9 #ifndef ZYPP_NG_CONTEXT_INCLUDED
10 #define ZYPP_NG_CONTEXT_INCLUDED
11 
12 #include <zypp-core/zyppng/async/AsyncOp>
13 #include <zypp-core/zyppng/ui/UserInterface>
14 #include <zypp/RepoManager.h>
15 
16 namespace zypp {
18  class ZConfig;
19 }
20 
21 namespace zyppng {
22 
24  ZYPP_FWD_DECL_TYPE_WITH_REFS( ProgressObserver );
27 
29  using KeyRingRef = zypp::KeyRing_Ptr;
30 
31  class ContextPrivate;
32 
33 
38  class Context : public UserInterface
39  {
40  ZYPP_DECLARE_PRIVATE(Context)
41  ZYPP_ADD_CREATE_FUNC(Context)
42 
43  public:
44 
46 
48 
49  template <typename AsyncRes>
50  void execute ( AsyncOpRef<AsyncRes> op ) {
51  if ( op->isReady () )
52  return;
53  return executeImpl( op );
54  }
55 
56  ProvideRef provider() const;
57  KeyRingRef keyRing () const;
59 
60  private:
61  void executeImpl ( const AsyncOpBaseRef& op );
62  };
63 
64 }
65 
66 
67 #endif
ZYPP_DECL_PRIVATE_CONSTR(Context)
zypp::KeyRing KeyRing
Definition: context.h:28
zypp::ZConfig & config()
Definition: context.cc:43
void execute(AsyncOpRef< AsyncRes > op)
Definition: context.h:50
Gpg key handling.
Definition: KeyRing.h:186
ProvideRef provider() const
Definition: context.cc:32
KeyRingRef keyRing() const
Definition: context.cc:38
zypp::KeyRing_Ptr KeyRingRef
Definition: context.h:29
ZYPP_FWD_DECL_TYPE_WITH_REFS(Context)
DEFINE_PTR_TYPE(Application)
Interim helper class to collect global options and settings.
Definition: ZConfig.h:63
void executeImpl(const AsyncOpBaseRef &op)
Definition: context.cc:48
Easy-to use interface to the ZYPP dependency resolver.
Definition: Application.cc:19