* This class emits the signal \c eSocketNotifier::activate whenever the
* event specified by \c req is available.
*/
* This class emits the signal \c eSocketNotifier::activate whenever the
* event specified by \c req is available.
*/
friend class eMainloop;
public:
enum { Read=POLLIN, Write=POLLOUT, Priority=POLLPRI, Error=POLLERR, Hungup=POLLHUP };
friend class eMainloop;
public:
enum { Read=POLLIN, Write=POLLOUT, Priority=POLLPRI, Error=POLLERR, Hungup=POLLHUP };
int state;
int requested; // requested events (POLLIN, ...)
void activate(int what) { /*emit*/ activated(what); }
int state;
int requested; // requested events (POLLIN, ...)
void activate(int what) { /*emit*/ activated(what); }
* \param req The events to watch to, normally either \c Read or \c Write. You can specify any events that \c poll supports.
* \param startnow Specifies if the socketnotifier should start immediately.
*/
* \param req The events to watch to, normally either \c Read or \c Write. You can specify any events that \c poll supports.
* \param startnow Specifies if the socketnotifier should start immediately.
*/
- eSocketNotifier(eMainloop *context, int fd, int req, bool startnow=true);
+ static eSocketNotifier* create(eMainloop *context, int fd, int req, bool startnow=true) { return new eSocketNotifier(context, fd, req, startnow); }
int getFD() { return fd; }
int getRequested() { return requested; }
void setRequested(int req) { requested=req; }
int getFD() { return fd; }
int getRequested() { return requested; }
void setRequested(int req) { requested=req; }
void addSocketNotifier(eSocketNotifier *sn);
void removeSocketNotifier(eSocketNotifier *sn);
void addTimer(eTimer* e);
void removeTimer(eTimer* e);
void addSocketNotifier(eSocketNotifier *sn);
void removeSocketNotifier(eSocketNotifier *sn);
void addTimer(eTimer* e);
void removeTimer(eTimer* e);
- :app_quit_now(0),loop_level(0),retval(0), m_is_idle(0), m_interrupt_requested(0)
+ :app_quit_now(0),loop_level(0),retval(0), m_is_idle(0), m_inActivate(0), m_interrupt_requested(0)
/* our new shared polling interface. */
PyObject *poll(SWIG_PYOBJECT(ePyObject) dict, SWIG_PYOBJECT(ePyObject) timeout);
void interruptPoll();
void reset();
/* our new shared polling interface. */
PyObject *poll(SWIG_PYOBJECT(ePyObject) dict, SWIG_PYOBJECT(ePyObject) timeout);
void interruptPoll();
void reset();
/* m_is_idle needs to be atomic, but it doesn't really matter much, as it's read-only from outside */
int isIdle() { return m_is_idle; }
};
/* m_is_idle needs to be atomic, but it doesn't really matter much, as it's read-only from outside */
int isIdle() { return m_is_idle; }
};
* The timer is not yet active, it has to be started with \c start.
* \param context The thread from which the signal should be emitted.
*/
* The timer is not yet active, it has to be started with \c start.
* \param context The thread from which the signal should be emitted.
*/
void start(long msec, bool b=false);
void stop();
void changeInterval(long msek);
void startLongTimer( int seconds );
bool operator<(const eTimer& t) const { return nextActivation < t.nextActivation; }
void start(long msec, bool b=false);
void stop();
void changeInterval(long msek);
void startLongTimer( int seconds );
bool operator<(const eTimer& t) const { return nextActivation < t.nextActivation; }