libzypp: zypp/ng/context.h Source File

libzypp 17.38.14

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
15namespace zypp {
16 DEFINE_PTR_TYPE(KeyRing);
17 class ZConfig;
18}
19
20namespace zyppng {
21
22 ZYPP_FWD_DECL_TYPE_WITH_REFS( Context );
23
24 using KeyRing = zypp::KeyRing;
25 using KeyRingRef = zypp::KeyRing_Ptr;
26
27 class ZYPP_API Context {
28
29 ZYPP_ADD_CREATE_FUNC(Context)
30
31 public:
32 ZYPP_DECL_PRIVATE_CONSTR(Context);
33
34 using ProvideType = Provide;
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 T>
52 auto joinPipeline( ContextRef ctx, T &&val ) {
53 return std::forward<T>(val);
54 }
55}
56
57#endif
DEFINE_PTR_TYPE
#define DEFINE_PTR_TYPE(NAME)
Forward declaration of Ptr types.
Definition PtrTypes.h:639
Target.h
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:82
zypp::sat::Pool
Global sat-pool.
Definition Pool.h:47
zyppng::Context
Definition context.h:27
zyppng::Context::ProvideType
Provide ProvideType
Definition context.h:34
zyppng::Context::isAsync
static constexpr auto isAsync
Definition context.h:35
zyppng::Context::config
zypp::ZConfig & config()
Definition context.cc:42
zyppng::Context::ZYPP_DECL_PRIVATE_CONSTR
ZYPP_DECL_PRIVATE_CONSTR(Context)
zyppng::Context::provider
ProvideRef provider() const
Definition context.cc:32
zyppng::Context::_media
ProvideRef _media
Definition context.h:48
zyppng::Context::pool
zypp::ResPool pool()
Definition context.cc:47
zyppng::Context::satPool
zypp::sat::Pool satPool()
Definition context.cc:57
zyppng::Context::poolProxy
zypp::ResPoolProxy poolProxy()
Definition context.cc:52
zyppng::Context::keyRing
KeyRingRef keyRing() const
Definition context.cc:37
zyppng::Context::defaultContext
static ContextRef defaultContext()
Definition context.cc:26
zyppng::Provide
Definition provide.h:103
zypp
Easy-to use interface to the ZYPP dependency resolver.
Definition CodePitfalls.doc:2
zypp::ZYPP_API
const Arch Arch_empty ZYPP_API
relates: Arch This is an empty Arch represented by an empty string.
Definition Arch.h:173
zyppng
Definition MediaNetworkRequestExecutor.h:16
zyppng::KeyRingRef
zypp::KeyRing_Ptr KeyRingRef
Definition context.h:25
zyppng::joinPipeline
auto joinPipeline(ContextRef ctx, T &&val)
Definition context.h:52
provide.h
ZYPP_ADD_CREATE_FUNC
#define ZYPP_ADD_CREATE_FUNC(Class)
Definition zyppglobal.h:198
ZYPP_FWD_DECL_TYPE_WITH_REFS
#define ZYPP_FWD_DECL_TYPE_WITH_REFS(T)
Definition zyppglobal.h:119