X-Git-Url: http://code.vuplus.com/gitweb/?p=vuplus_dvbapp;a=blobdiff_plain;f=lib%2Fbase%2Febase.h;h=f6fc07d3c423f6166c91e0e69a369e69ab156386;hp=c86c177ddd08e79e592143bbe7956620b041c556;hb=19a3bfd167508654566d8cf0ac32e9256839851c;hpb=0c59a4279f93f08fe95fca5f2e55f3e025f0cceb diff --git a/lib/base/ebase.h b/lib/base/ebase.h index c86c177..f6fc07d 100644 --- a/lib/base/ebase.h +++ b/lib/base/ebase.h @@ -155,7 +155,6 @@ private: int requested; // requested events (POLLIN, ...) void activate(int what) { /*emit*/ activated(what); } eSocketNotifier(eMainloop *context, int fd, int req, bool startnow); - void operator delete(void *pmem) { ::operator delete(pmem); } public: /** * \brief Constructs a eSocketNotifier. @@ -196,6 +195,8 @@ class eMainloop int processOneEvent(unsigned int user_timeout, PyObject **res=0, ePyObject additional=ePyObject()); int retval; int m_is_idle; + int m_idle_count; + eSocketNotifier *m_inActivate; int m_interrupt_requested; timespec m_twisted_timer; // twisted timer @@ -204,13 +205,11 @@ class eMainloop void removeSocketNotifier(eSocketNotifier *sn); void addTimer(eTimer* e); void removeTimer(eTimer* e); -public: -#ifndef SWIG static ePtrList existing_loops; -#endif - + static bool isValid(eMainloop *); +public: eMainloop() - :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_idle_count(0), m_inActivate(0), m_interrupt_requested(0) { existing_loops.push_back(this); } @@ -240,6 +239,7 @@ public: /* 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; } + int idleCount() { return m_idle_count; } }; /** @@ -281,7 +281,6 @@ class eTimer: iObject void activate(); eTimer(eMainloop *context): context(*context), bActive(false) { } - void operator delete(void *pmem) { ::operator delete(pmem); } public: /** * \brief Constructs a timer.