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

libzypp 17.38.15

socketnotifier.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
15#ifndef ZYPPNG_BASE_SOCKETNOTIFIER_H_DEFINED
16#define ZYPPNG_BASE_SOCKETNOTIFIER_H_DEFINED
17
18#include <zypp-core/ng/base/zyppglobal.h>
19#include <zypp-core/ng/base/AbstractEventSource>
20#include <zypp-core/ng/base/Signals>
21
22namespace zyppng {
23class SocketNotifierPrivate;
24
68 class SocketNotifier : public AbstractEventSource
69{
70 ZYPP_DECLARE_PRIVATE( SocketNotifier )
71public:
72
73 using Ptr = std::shared_ptr<SocketNotifier>;
74 using WeakPtr = std::weak_ptr<SocketNotifier>;
75
76 using EventTypes = AbstractEventSource::EventTypes;
77
84 static Ptr create ( int socket, int evTypes, bool enable = true );
85
90 void setMode ( int mode );
91
96 int mode () const;
97
101 void setEnabled ( bool enabled = true );
102
106 int socket () const;
107
111 SignalProxy<void (const SocketNotifier &sock, int evTypes)> sigActivated();
112
113protected:
114 SocketNotifier( int socket, int evTypes );
115
116 // AbstractEventSource interface
117public:
118 void onFdReady(int, int events) override;
119 void onSignal(int signal) override;
120};
121
122}
123
124#endif
zyppng::AbstractEventSource::AbstractEventSource
AbstractEventSource()
Definition abstracteventsource.cc:20
zyppng::AbstractEventSource::EventTypes
EventTypes
Definition abstracteventsource.h:46
zyppng::SignalProxy
Definition signals.h:325
zyppng::SocketNotifierPrivate
Definition socketnotifier.cc:7
zyppng::SocketNotifier::SocketNotifier
SocketNotifier(int socket, int evTypes)
Definition socketnotifier.cc:25
zyppng::SocketNotifier::Ptr
std::shared_ptr< SocketNotifier > Ptr
Definition socketnotifier.h:73
zyppng::SocketNotifier::onSignal
void onSignal(int signal) override
Definition socketnotifier.cc:86
zyppng::SocketNotifier::create
static Ptr create(int socket, int evTypes, bool enable=true)
Definition socketnotifier.cc:33
zyppng::SocketNotifier::socket
int socket() const
Definition socketnotifier.cc:71
zyppng::SocketNotifier::onFdReady
void onFdReady(int, int events) override
Definition socketnotifier.cc:81
zyppng::SocketNotifier::EventTypes
AbstractEventSource::EventTypes EventTypes
Definition socketnotifier.h:76
zyppng::SocketNotifier::mode
int mode() const
Definition socketnotifier.cc:52
zyppng::SocketNotifier::sigActivated
SignalProxy< void(const SocketNotifier &sock, int evTypes)> sigActivated()
Definition socketnotifier.cc:76
zyppng::SocketNotifier::WeakPtr
std::weak_ptr< SocketNotifier > WeakPtr
Definition socketnotifier.h:74
zyppng::SocketNotifier::setMode
void setMode(int mode)
Definition socketnotifier.cc:40
zyppng::SocketNotifier::setEnabled
void setEnabled(bool enabled=true)
Definition socketnotifier.cc:57
zyppng
Definition MediaNetworkRequestExecutor.h:16
zyppglobal.h
ZYPP_DECLARE_PRIVATE
#define ZYPP_DECLARE_PRIVATE(Class)
Definition zyppglobal.h:80