libzypp 17.37.17
abstracteventsource.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_NG_BASE_ABSTRACTEVENTSOURCE_H_INCLUDED
15#define ZYPP_NG_BASE_ABSTRACTEVENTSOURCE_H_INCLUDED
16
18#include <zypp-core/zyppng/base/Signals>
19#include <zypp-core/zyppng/base/Base>
20
21namespace zyppng {
22
23class EventDispatcher;
25
38{
40public:
41
47 Read = 0x01, //< The fd is ready to read data without blocking
48 Write = 0x02, //< The fd has written pending data
49 Exception = 0x04, //< A exception has happend on the fd
50 Error = 0x08 //< There was a error polling the fd
51 };
52
55 ~AbstractEventSource() override;
56
60 std::weak_ptr<EventDispatcher> eventDispatcher () const;
61
67 virtual void onFdReady ( int fd, int events ) = 0;
68
73 virtual void onSignal ( int signal ) = 0;
74
75protected:
81 void updateFdWatch ( int fd, int mode );
82
87 void removeFdWatch ( int fd );
88};
89
90}
91
92#endif
virtual void onSignal(int signal)=0
virtual void onFdReady(int fd, int events)=0
void updateFdWatch(int fd, int mode)
#define ZYPP_DECLARE_PRIVATE(Class)
Definition zyppglobal.h:87
#define LIBZYPP_NG_EXPORT
Definition zyppglobal.h:8