summaryrefslogtreecommitdiff
path: root/comm/TimeOut.cc
diff options
context:
space:
mode:
Diffstat (limited to 'comm/TimeOut.cc')
-rw-r--r--comm/TimeOut.cc24
1 files changed, 20 insertions, 4 deletions
diff --git a/comm/TimeOut.cc b/comm/TimeOut.cc
index 72a30e2..c6cb78e 100644
--- a/comm/TimeOut.cc
+++ b/comm/TimeOut.cc
@@ -17,6 +17,22 @@
#include "ccu/Signal.h"
#include "Multiplexer.h"
+/*?class UchBaseTimeOut
+The class \typ{UchBaseTimeOut} is provided as a base class for multiplexer-based timers.
+It is a derived class of \typ{CcuCoreTimer}.
+It comes with a derived class \typ{UchTimeOut} that can be used as is.
+A timer is created with a period expressed in milliseconds. It will then
+periodically call the member function \fun{Handle}, which should be redefined
+in derived classes.
+?*/
+
+/*?
+Create a timer associated to the multiplexer \var{m},
+that will send a signal every \var{period} milliseconds, \var{pulses} times.
+If \var{pulses} is negative, the timer will send signals forever.
+Timers are activated at creation time. They are disactivated, but not destroyed, after
+their last pulse.
+?*/
UchBaseTimeOut :: UchBaseTimeOut (UchBaseMultiplexer& m, Millisecond period, int pulses)
: CcuCoreTimer (period, pulses, m.GetTimerSet ()),
MyMpx (m)
@@ -27,7 +43,7 @@ UchBaseTimeOut :: UchBaseTimeOut (UchBaseMultiplexer& m, Millisecond period, int
Activate ();
}
-/*?hidden?*/
+/*?nodoc?*/
UchBaseTimeOut :: ~UchBaseTimeOut ()
{
/* stop it */
@@ -61,7 +77,8 @@ take a \typ{Millisecond} argument and return \typ{void}.
?*/
/*?
-Create a timer associated to the multiplexer \var{m}, that will expire every \var{period} milliseconds and call
+Create a timer associated to the multiplexer \var{m},
+that will expire every \var{period} milliseconds and call
the function \var{handler}.
?*/
UchTimeOut :: UchTimeOut (UchBaseMultiplexer& m, Millisecond period, void (*handler) (Millisecond), int pulses)
@@ -75,10 +92,9 @@ UchTimeOut :: ~UchTimeOut ()
{
}
-/*?nodoc?*/
+/*?hidden?*/
void
UchTimeOut :: Handle (Millisecond ref)
{
(*Handler) (ref);
}
-