libzypp 17.37.17
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
19#include <zypp-core/zyppng/base/AbstractEventSource>
20#include <zypp-core/zyppng/base/Signals>
21
22namespace zyppng {
24
69{
71public:
72
73 using Ptr = std::shared_ptr<SocketNotifier>;
74 using WeakPtr = std::weak_ptr<SocketNotifier>;
75
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
SocketNotifier(int socket, int evTypes)
std::shared_ptr< SocketNotifier > Ptr
void onSignal(int signal) override
static Ptr create(int socket, int evTypes, bool enable=true)
void onFdReady(int, int events) override
AbstractEventSource::EventTypes EventTypes
SignalProxy< void(const SocketNotifier &sock, int evTypes)> sigActivated()
std::weak_ptr< SocketNotifier > WeakPtr
void setEnabled(bool enabled=true)
#define ZYPP_DECLARE_PRIVATE(Class)
Definition zyppglobal.h:87