|
libzypp
17.22.0
|
#include <socketnotifier.h>

Public Types | |
| using | Ptr = std::shared_ptr< SocketNotifier > |
| using | WeakPtr = std::weak_ptr< SocketNotifier > |
| using | EventTypes = AbstractEventSource::EventTypes |
Public Types inherited from zyppng::AbstractEventSource | |
| enum | EventTypes { Read = 0x01, Write = 0x02, Exception = 0x04, Error = 0x08 } |
Public Types inherited from zyppng::Base | |
| using | Ptr = std::shared_ptr< Base > |
| using | WeakPtr = std::weak_ptr< Base > |
Public Member Functions | |
| void | setMode (int mode) |
| int | mode () const |
| void | setEnabled (bool enabled=true) |
| int | socket () const |
| SignalProxy< void(const SocketNotifier &sock, int evTypes)> | sigActivated () |
| void | onFdReady (int, int events) override |
| void | onSignal (int signal) override |
Public Member Functions inherited from zyppng::AbstractEventSource | |
| AbstractEventSource () | |
| AbstractEventSource (AbstractEventSourcePrivate &dd) | |
| virtual | ~AbstractEventSource () |
| std::weak_ptr< EventDispatcher > | eventDispatcher () const |
Public Member Functions inherited from zyppng::Base | |
| Base () | |
| virtual | ~Base () |
| WeakPtr | parent () const |
| void | addChild (Base::Ptr child) |
| void | removeChild (Ptr child) |
| const std::unordered_set< Ptr > & | children () const |
| template<typename T > | |
| std::vector< std::weak_ptr< T > > | findChildren () const |
| template<typename T > | |
| std::shared_ptr< T > | shared_this () const |
| template<typename T > | |
| std::shared_ptr< T > | shared_this () |
| template<typename T > | |
| std::weak_ptr< T > | weak_this () const |
| template<typename T > | |
| std::weak_ptr< T > | weak_this () |
Static Public Member Functions | |
| static Ptr | create (int socket, int evTypes, bool enable=true) |
Protected Member Functions | |
| SocketNotifier (int socket, int evTypes, bool enable) | |
Protected Member Functions inherited from zyppng::AbstractEventSource | |
| void | updateFdWatch (int fd, int mode) |
| void | removeFdWatch (int fd) |
Protected Member Functions inherited from zyppng::Base | |
| Base (BasePrivate &dd) | |
Additional Inherited Members | |
Protected Attributes inherited from zyppng::Base | |
| std::unique_ptr< BasePrivate > | d_ptr |
The SocketNotifier class provides a generic way to monitor activity on a file descriptors.
Once a file descriptor was created using either low level OS API or was created by a 3rd party library, the SocketNotifier can be created to integrate the file descriptor into the event loop.
Each file descriptor can be monitored for all types of activiy supported by the base class
Definition at line 65 of file socketnotifier.h.
| using zyppng::SocketNotifier::Ptr = std::shared_ptr<SocketNotifier> |
Definition at line 70 of file socketnotifier.h.
| using zyppng::SocketNotifier::WeakPtr = std::weak_ptr<SocketNotifier> |
Definition at line 71 of file socketnotifier.h.
Definition at line 73 of file socketnotifier.h.
|
protected |
Definition at line 19 of file socketnotifier.cc.
|
static |
Returns a new SocketNotifier
| socket | this is the filedescriptor to be modified |
| evTypes | the event types that should be monitored |
| enable | If set to true the notifier is enabled right away, otherwise |
Definition at line 29 of file socketnotifier.cc.
| void zyppng::SocketNotifier::setMode | ( | int | mode | ) |
Update the fd watch to the mode specified.
Definition at line 34 of file socketnotifier.cc.
| int zyppng::SocketNotifier::mode | ( | ) | const |
Returns the current mode used to monitor the file descriptor
Definition at line 46 of file socketnotifier.cc.
| void zyppng::SocketNotifier::setEnabled | ( | bool | enabled = true | ) |
Enables or disables the SocketNotifier
Definition at line 51 of file socketnotifier.cc.
| int zyppng::SocketNotifier::socket | ( | ) | const |
Returns the monitored file descriptor
Definition at line 65 of file socketnotifier.cc.
| SignalProxy< void(const SocketNotifier &, int)> zyppng::SocketNotifier::sigActivated | ( | ) |
Emitted when there is activity on the socket according to the requested mode
Definition at line 70 of file socketnotifier.cc.
|
overridevirtual |
Called by the
Implements zyppng::AbstractEventSource.
Definition at line 75 of file socketnotifier.cc.
|
overridevirtual |
Called when a event source has registered to receive unix signals
Implements zyppng::AbstractEventSource.
Definition at line 80 of file socketnotifier.cc.