summaryrefslogtreecommitdiff
path: root/comm/SignalHandler.cc
diff options
context:
space:
mode:
authorchatty1993-11-29 12:26:28 +0000
committerchatty1993-11-29 12:26:28 +0000
commit6c94d966c65c67090ea04d5798eb4278332facee (patch)
tree977a1817fa3267d8d2b7a25b1937c1d1a5fc6282 /comm/SignalHandler.cc
parente39958a0286983c30d09c544786e7ceeef2dea4f (diff)
downloadivy-league-6c94d966c65c67090ea04d5798eb4278332facee.zip
ivy-league-6c94d966c65c67090ea04d5798eb4278332facee.tar.gz
ivy-league-6c94d966c65c67090ea04d5798eb4278332facee.tar.bz2
ivy-league-6c94d966c65c67090ea04d5798eb4278332facee.tar.xz
Added documentation
Diffstat (limited to 'comm/SignalHandler.cc')
-rw-r--r--comm/SignalHandler.cc46
1 files changed, 43 insertions, 3 deletions
diff --git a/comm/SignalHandler.cc b/comm/SignalHandler.cc
index 1315812..3fc7fab 100644
--- a/comm/SignalHandler.cc
+++ b/comm/SignalHandler.cc
@@ -16,39 +16,79 @@
#include "Signal.h"
#include "Multiplexer.h"
+/*?class UchBaseSignalHandler
+The class \typ{UchBaseSignalHandler} is provided as a base class for safe signal handlers,
+ie. signal handlers that are activated only when no data is being transferred on a channel.
+It is a derived class of \typ{CcuBaseSignalHandler}, in which the method \fun{Handle} is
+defined to hold the signal until safe times. The virtual function \fun{DeferredHandle},
+that should be redefined in derived classes, is called later.
+The class \typ{UchBaseSignalHandler} comes with a derived class
+\typ{CcuSignalHandler} that can be used as is, without any derivation.
+?*/
+
+/*?
+Create a signal handler associated to the multiplexer \var{m},
+for the signal \var{sig}.
+?*/
UchBaseSignalHandler :: UchBaseSignalHandler (UchBaseMultiplexer& m, int sig)
: CcuBaseSignalHandler (sig),
MyMpx (m)
{
}
+/*?nodoc?*/
UchBaseSignalHandler :: ~UchBaseSignalHandler ()
{
}
-
+/*!
+Ask the multiplexer to hold the signal and call us when it is safe.
+!*/
+/*?hidden?*/
void
UchBaseSignalHandler :: Handle ()
{
MyMpx.HandleSignal (*this);
}
+/*?
+This virtual function should be redefined in derived classes. It is called
+when a signal should be handled. As the handling of the signal was
+deferred, it may happen that a signal was received more than once
+before being handled; \var{nb} holds the number of identical signals
+that were received. This function is not called during an
+interruption, and does not suffer any constraint.
+?*/
void
-UchBaseSignalHandler :: DeferredHandle (int)
+UchBaseSignalHandler :: DeferredHandle (int nb)
{
}
+/*?class UchSignalHandler
+The class \typ{UchSignalHandler} is a derived class of \typ{UchBaseSignalHandler} that
+can be used without deriving a new class.
+Each \typ{UchSignalHandler} holds a pointer to a function which is called when a
+signal is received. This function, which is passed to the constructor, must
+take an \typ{int} argument and return \typ{void}.
+?*/
+
+/*?
+Create a signal handler for signal \var{sig}. The function \var{h} will be
+called when a signal has to be handled. Its two arguments are the identification
+of the signal, and the number of signals that were received.
+?*/
UchSignalHandler :: UchSignalHandler (UchBaseMultiplexer& m, int sig, void (*h) (int, int))
: UchBaseSignalHandler (m, sig),
Handler (h)
{
}
+/*?nodoc?*/
UchSignalHandler :: ~UchSignalHandler ()
{
}
-
+/*?hidden?*/
void
UchSignalHandler :: DeferredHandle (int nb)
{