git.cweiske.de
/
enigma2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
resize ChannelSelection_summary to fit on 96x64 displays
[enigma2.git]
/
lib
/
base
/
ebase.h
diff --git
a/lib/base/ebase.h
b/lib/base/ebase.h
index 10b46120a3e7737033f2756d468e36c8eb597e8f..c69133f621239a431b1bc74254df93979044f5cf 100644
(file)
--- a/
lib/base/ebase.h
+++ b/
lib/base/ebase.h
@@
-142,8
+142,9
@@
class eMainloop;
* 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.
*/
-class eSocketNotifier
+class eSocketNotifier
: iObject
{
{
+ DECLARE_REF(eSocketNotifier);
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 };
@@
-153,6
+154,7
@@
private:
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); }
+ eSocketNotifier(eMainloop *context, int fd, int req, bool startnow);
public:
/**
* \brief Constructs a eSocketNotifier.
public:
/**
* \brief Constructs a eSocketNotifier.
@@
-161,7
+163,7
@@
public:
* \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); }
~eSocketNotifier();
PSignal1<void, int> activated;
~eSocketNotifier();
PSignal1<void, int> activated;
@@
-173,6
+175,8
@@
public:
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; }
+
+ eSmartPtrList<iObject> m_clients;
};
#endif
};
#endif
@@
-191,6
+195,8
@@
class eMainloop
int processOneEvent(unsigned int user_timeout, PyObject **res=0, ePyObject additional=ePyObject());
int retval;
int m_is_idle;
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
int m_interrupt_requested;
timespec m_twisted_timer; // twisted timer
@@
-205,7
+211,7
@@
public:
#endif
eMainloop()
#endif
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_i
dle_count(0), m_inActivate(0), m_i
nterrupt_requested(0)
{
existing_loops.push_back(this);
}
{
existing_loops.push_back(this);
}
@@
-235,6
+241,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; }
/* 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; }
};
/**
};
/**
@@
-264,8
+271,9
@@
public:
*
* This class emits the signal \c eTimer::timeout after the specified timeout.
*/
*
* This class emits the signal \c eTimer::timeout after the specified timeout.
*/
-class eTimer
+class eTimer
: iObject
{
{
+ DECLARE_REF(eTimer);
friend class eMainloop;
eMainloop &context;
timespec nextActivation;
friend class eMainloop;
eMainloop &context;
timespec nextActivation;
@@
-273,6
+281,8
@@
class eTimer
bool bSingleShot;
bool bActive;
void activate();
bool bSingleShot;
bool bActive;
void activate();
+
+ eTimer(eMainloop *context): context(*context), bActive(false) { }
public:
/**
* \brief Constructs a timer.
public:
/**
* \brief Constructs a timer.
@@
-280,7
+290,7
@@
public:
* 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.
*/
-
eTimer(eMainloop *context=eApp): context(*context), bActive(false) {
}
+
static eTimer *create(eMainloop *context=eApp) { return new eTimer(context);
}
~eTimer() { if (bActive) stop(); }
PSignal0<void> timeout;
~eTimer() { if (bActive) stop(); }
PSignal0<void> timeout;
@@
-294,6
+304,7
@@
public:
void changeInterval(long msek);
void startLongTimer( int seconds );
bool operator<(const eTimer& t) const { return nextActivation < t.nextActivation; }
void changeInterval(long msek);
void startLongTimer( int seconds );
bool operator<(const eTimer& t) const { return nextActivation < t.nextActivation; }
+ eSmartPtrList<iObject> m_clients;
};
#endif // SWIG
};
#endif // SWIG