libzypp: zypp/ng/workflows/contextfacade.h Source File

libzypp 17.36.6

contextfacade.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/ng/context.h"
13#include <zypp/ng/workflows/mediafacade.h>
14
15namespace zypp {
16 DEFINE_PTR_TYPE(KeyRing);
17 class ZConfig;
18}
19
20namespace zyppng {
21
22 ZYPP_FWD_DECL_TYPE_WITH_REFS( SyncContext );
23
24 using KeyRing = zypp::KeyRing;
25 using KeyRingRef = zypp::KeyRing_Ptr;
26
27 class ZYPP_API SyncContext {
28
29 ZYPP_ADD_CREATE_FUNC(SyncContext)
30
31 public:
32 ZYPP_DECL_PRIVATE_CONSTR(SyncContext);
33
34 using ProvideType = MediaSyncFacade;
35
36 static SyncContextRef defaultContext();
37
38 MediaSyncFacadeRef provider() const;
39 KeyRingRef keyRing () const;
40 zypp::ZConfig &config();
41 zypp::ResPool pool();
42 zypp::ResPoolProxy poolProxy();
43 zypp::sat::Pool satPool();
44
45
46 private:
47 MediaSyncFacadeRef _media;
48 };
49
50 template<typename OpType>
51 using MaybeAsyncContextRef = std::conditional_t<detail::is_async_op_v<OpType>, ContextRef, SyncContextRef>;
52
53 template<typename T>
54 auto joinPipeline( SyncContextRef ctx, T &&val ) {
55 return std::forward<T>(val);
56 }
57}
58
59#endif
zypp::KeyRing
Gpg key handling.
Definition KeyRing.h:170
zypp::ResPoolProxy
ResPool::instance().proxy();.
Definition ResPoolProxy.h:36
zypp::ResPool
Global ResObject pool.
Definition ResPool.h:62
zypp::ZConfig
Interim helper class to collect global options and settings.
Definition ZConfig.h:69
zypp::sat::Pool
Global sat-pool.
Definition Pool.h:47
zyppng::MediaSyncFacade
Definition mediafacade.h:49
zyppng::SyncContext
Definition contextfacade.h:27
zyppng::SyncContext::config
zypp::ZConfig & config()
Definition contextfacade.cc:42
zyppng::SyncContext::pool
zypp::ResPool pool()
Definition contextfacade.cc:47
zyppng::SyncContext::keyRing
KeyRingRef keyRing() const
Definition contextfacade.cc:37
zyppng::SyncContext::ZYPP_DECL_PRIVATE_CONSTR
ZYPP_DECL_PRIVATE_CONSTR(SyncContext)
zyppng::SyncContext::defaultContext
static SyncContextRef defaultContext()
Definition contextfacade.cc:26
zyppng::SyncContext::satPool
zypp::sat::Pool satPool()
Definition contextfacade.cc:57
zyppng::SyncContext::poolProxy
zypp::ResPoolProxy poolProxy()
Definition contextfacade.cc:52
zyppng::SyncContext::ProvideType
MediaSyncFacade ProvideType
Definition contextfacade.h:34
zyppng::SyncContext::provider
MediaSyncFacadeRef provider() const
Definition contextfacade.cc:32
zyppng::SyncContext::_media
MediaSyncFacadeRef _media
Definition contextfacade.h:47
context.h
mediafacade.h
std::conditional_t
typename conditional< B, T, F >::type conditional_t
Definition TypeTraits.h:39
zypp
Easy-to use interface to the ZYPP dependency resolver.
Definition Application.cc:20
zypp::ZYPP_API
const Arch Arch_armv7hnl Arch_armv7nhl ZYPP_API
Definition Arch.h:247
zyppng
Definition MediaCurl2.h:22
zyppng::KeyRingRef
zypp::KeyRing_Ptr KeyRingRef
Definition context.h:29
zyppng::joinPipeline
auto joinPipeline(ContextRef ctx, AsyncOpRef< T > res)
Definition context.h:81
zyppng::MaybeAsyncContextRef
std::conditional_t< detail::is_async_op_v< OpType >, ContextRef, SyncContextRef > MaybeAsyncContextRef
Definition contextfacade.h:51
DEFINE_PTR_TYPE
#define DEFINE_PTR_TYPE(NAME)
Forward declaration of Ptr types.
Definition PtrTypes.h:639
ZYPP_ADD_CREATE_FUNC
#define ZYPP_ADD_CREATE_FUNC(Class)
Definition zyppglobal.h:205
ZYPP_FWD_DECL_TYPE_WITH_REFS
#define ZYPP_FWD_DECL_TYPE_WITH_REFS(T)
Definition zyppglobal.h:126