libzypp  17.37.18
context.h
Go to the documentation of this file.
1 /*---------------------------------------------------------------------\
2 | ____ _ __ __ ___ |
3 | |__ / \ / / . \ . \ |
4 | / / \ V /| _/ _/ |
5 | / /__ | | | | | | |
6 | /_____||_| |_| |_| |
7 | |
8 \---------------------------------------------------------------------*/
9 #ifndef ZYPP_NG_CONTEXTFACADE_INCLUDED
10 #define ZYPP_NG_CONTEXTFACADE_INCLUDED
11 
12 #include <zypp/Target.h>
13 #include <zypp/ng/media/provide.h>
14 
15 namespace zypp {
17  class ZConfig;
18 }
19 
20 namespace zyppng {
21 
23 
25  using KeyRingRef = zypp::KeyRing_Ptr;
26 
27  class ZYPP_API Context {
28 
30 
31  public:
33 
35  static constexpr auto isAsync = false;
36 
37  static ContextRef defaultContext();
38 
39  ProvideRef provider() const;
40  KeyRingRef keyRing () const;
41  zypp::ZConfig &config();
42  zypp::ResPool pool();
43  zypp::ResPoolProxy poolProxy();
44  zypp::sat::Pool satPool();
45 
46 
47  private:
48  ProvideRef _media;
49  };
50 
51  template<typename OpType>
53 
54  template<typename T>
55  auto joinPipeline( ContextRef ctx, T &&val ) {
56  return std::forward<T>(val);
57  }
58 }
59 
60 #endif
zypp::KeyRing KeyRing
Definition: context.h:24
std::conditional_t< detail::is_async_op_v< OpType >, ContextRef, ContextRef > MaybeAsyncContextRef
Definition: context.h:52
auto joinPipeline(ContextRef ctx, T &&val)
Definition: context.h:55
#define ZYPP_ADD_CREATE_FUNC(Class)
Definition: zyppglobal.h:205
zypp::KeyRing_Ptr KeyRingRef
Definition: context.h:25
DEFINE_PTR_TYPE(KeyRing)
#define ZYPP_API
Definition: Globals.h:69
typename conditional< B, T, F >::type conditional_t
Definition: TypeTraits.h:39
#define ZYPP_DECL_PRIVATE_CONSTR(Class)
Definition: zyppglobal.h:221
ZYPP_FWD_DECL_TYPE_WITH_REFS(EventDispatcher)
ProvideRef _media
Definition: context.h:48