*
* 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;
bool bSingleShot;
bool bActive;
void activate();
+
+ eTimer(eMainloop *context): context(*context), bActive(false) { }
public:
/**
* \brief Constructs a timer.
* 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;
void changeInterval(long msek);
void startLongTimer( int seconds );
bool operator<(const eTimer& t) const { return nextActivation < t.nextActivation; }
+ eSmartPtrList<iObject> m_clients;
};
#endif // SWIG