libzypp: zypp-core/ng/base/eventloop.h Source File

libzypp 17.38.14

eventloop.h
Go to the documentation of this file.
1/*---------------------------------------------------------------------\
2| ____ _ __ __ ___ |
3| |__ / \ / / . \ . \ |
4| / / \ V /| _/ _/ |
5| / /__ | | | | | | |
6| /_____||_| |_| |_| |
7| |
8\----------------------------------------------------------------------/
9*
10* This file contains private API, this might break at any time between releases.
11* You have been warned!
12*
13*/
14#ifndef ZYPP_BASE_EVENTLOOP_DEFINED
15#define ZYPP_BASE_EVENTLOOP_DEFINED
16
17#include <zypp-core/ng/base/zyppglobal.h>
18#include <zypp-core/ng/base/Signals>
19#include <zypp-core/ng/base/Base>
20
21typedef struct _GMainContext GMainContext;
22
23namespace zyppng {
24
25 ZYPP_FWD_DECL_TYPE_WITH_REFS ( EventDispatcher );
26 ZYPP_FWD_DECL_TYPE_WITH_REFS ( EventLoop );
27 class EventLoopPrivate;
28
29 ZYPP_FWD_DECL_TYPE_WITH_REFS(EventLoop);
30
42 class EventLoop : public Base
43 {
44 ZYPP_DECLARE_PRIVATE(EventLoop)
45
46 public:
47 using Ptr = EventLoopRef;
48 using WeakPtr = EventLoopWeakRef;
49
50 static Ptr create ( GMainContext *ctx = nullptr );
51 static Ptr create ( EventDispatcherRef dispatcher );
52 ~EventLoop() override;
53
57 void run ();
58
62 void quit ();
63
64
68 std::shared_ptr<EventDispatcher> eventDispatcher () const;
69
70 private:
71 EventLoop( GMainContext *ctx = nullptr );
72 EventLoop( EventDispatcherRef dispatcher );
73
74 };
75
76}
77
78#endif
zyppng::Base::Base
Base()
Definition base.cc:20
zyppng::EventDispatcher
Definition eventdispatcher.h:43
zyppng::EventLoopPrivate
Definition eventloop_glib_p.h:12
zyppng::EventLoop
Definition eventloop.h:43
zyppng::EventLoop::run
void run()
Definition eventloop_glib.cc:40
zyppng::EventLoop::Ptr
EventLoopRef Ptr
Definition eventloop.h:47
zyppng::EventLoop::quit
void quit()
Definition eventloop_glib.cc:51
zyppng::EventLoop::EventLoop
EventLoop(GMainContext *ctx=nullptr)
Definition eventloop_glib.cc:20
zyppng::EventLoop::create
static Ptr create(GMainContext *ctx=nullptr)
Definition eventloop_glib.cc:29
zyppng::EventLoop::~EventLoop
~EventLoop() override
Definition eventloop_glib.cc:24
zyppng::EventLoop::eventDispatcher
std::shared_ptr< EventDispatcher > eventDispatcher() const
Definition eventloop_glib.cc:56
zyppng::EventLoop::WeakPtr
EventLoopWeakRef WeakPtr
Definition eventloop.h:48
GMainContext
struct _GMainContext GMainContext
Definition eventdispatcher.h:24
zyppng
Definition MediaNetworkRequestExecutor.h:16
zyppglobal.h
ZYPP_DECLARE_PRIVATE
#define ZYPP_DECLARE_PRIVATE(Class)
Definition zyppglobal.h:80
ZYPP_FWD_DECL_TYPE_WITH_REFS
#define ZYPP_FWD_DECL_TYPE_WITH_REFS(T)
Definition zyppglobal.h:119