libzypp 17.37.17
|
#include <zypp-core/zyppng/base/abstracteventsource.h>
Public Types | |
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 | |
AbstractEventSource () | |
AbstractEventSource (AbstractEventSourcePrivate &dd) | |
~AbstractEventSource () override | |
std::weak_ptr< EventDispatcher > | eventDispatcher () const |
virtual void | onFdReady (int fd, int events)=0 |
virtual void | onSignal (int signal)=0 |
Public Member Functions inherited from zyppng::Base | |
Base () | |
virtual | ~Base () |
WeakPtr | parent () const |
void | addChild (const Base::Ptr &child) |
void | removeChild (const Ptr &child) |
const std::unordered_set< Ptr > & | children () const |
std::thread::id | threadId () 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 () |
template<typename SenderFunc, typename ReceiverFunc> | |
auto | connect (SenderFunc &&sFun, typename internal::MemberFunction< ReceiverFunc >::ClassType &recv, ReceiverFunc &&rFunc) |
template<typename SenderFunc, typename ReceiverFunc, typename ... Tracker> | |
std::enable_if_t< std::is_member_function_pointer_v< SenderFunc >, connection > | connectFunc (SenderFunc &&sFun, ReceiverFunc &&rFunc, const Tracker &...trackers) |
Protected Member Functions | |
void | updateFdWatch (int fd, int mode) |
void | removeFdWatch (int fd) |
Protected Member Functions inherited from zyppng::Base | |
Base (BasePrivate &dd) |
Additional Inherited Members | |
Static Public Member Functions inherited from zyppng::Base | |
template<typename Obj, typename Functor> | |
static decltype(auto) | make_base_slot (Obj *o, Functor &&f) |
template<typename SenderFunc, typename ReceiverFunc> | |
static auto | connect (typename internal::MemberFunction< SenderFunc >::ClassType &s, SenderFunc &&sFun, typename internal::MemberFunction< ReceiverFunc >::ClassType &recv, ReceiverFunc &&rFunc) |
template<typename SenderFunc, typename ReceiverFunc, typename ... Tracker> | |
static auto | connectFunc (typename internal::MemberFunction< SenderFunc >::ClassType &s, SenderFunc &&sFun, ReceiverFunc &&rFunc, const Tracker &...trackers) |
Protected Attributes inherited from zyppng::Base | |
std::unique_ptr< BasePrivate > | d_ptr |
The AbstractEventSource class is the base class for all objects that can be tracked using one or more file descriptors
A subclass can register multiple file descriptors to be tracked using updateFdWatch and remove them with removeFdWatch. This is internally forwarded to the
In case there is activity on the file descriptor the EventDispatcher wakes up and forwards it to onFdReady.
Definition at line 37 of file abstracteventsource.h.
The different types of events a AbstractEventSource can listen for.
Enumerator | |
---|---|
Read | |
Write | |
Exception | |
Error |
Definition at line 46 of file abstracteventsource.h.
zyppng::AbstractEventSource::AbstractEventSource | ( | ) |
Definition at line 20 of file abstracteventsource.cc.
zyppng::AbstractEventSource::AbstractEventSource | ( | AbstractEventSourcePrivate & | dd | ) |
Definition at line 24 of file abstracteventsource.cc.
|
override |
Definition at line 28 of file abstracteventsource.cc.
std::weak_ptr< EventDispatcher > zyppng::AbstractEventSource::eventDispatcher | ( | ) | const |
Returns the
Definition at line 37 of file abstracteventsource.cc.
|
pure virtual |
Called by the
Implemented in zyppng::AsyncQueueWatch, zyppng::SocketNotifier, and zyppng::UnixSignalSource.
|
pure virtual |
Called when a event source has registered to receive unix signals
Implemented in zyppng::AsyncQueueWatch, zyppng::SocketNotifier, and zyppng::UnixSignalSource.
|
protected |
Register or update a file descriptor poll mode.
fd | The fd to add or update to the watchlist of the |
mode | The watchmode used in the watchlist |
Definition at line 42 of file abstracteventsource.cc.
|
protected |
Removes the given fd from the
Definition at line 52 of file abstracteventsource.cc.