summaryrefslogtreecommitdiff
path: root/dnn
diff options
context:
space:
mode:
authorchatty2000-11-28 14:52:15 +0000
committerchatty2000-11-28 14:52:15 +0000
commita38e6d7cf946ce15e4a67bcbd1ffbeaec532763a (patch)
tree924532f1e693da875ca903913d2f322d6ffe774c /dnn
parente47241a79bce51379d37c728d9d4674ee9086f7e (diff)
downloadivy-league-a38e6d7cf946ce15e4a67bcbd1ffbeaec532763a.zip
ivy-league-a38e6d7cf946ce15e4a67bcbd1ffbeaec532763a.tar.gz
ivy-league-a38e6d7cf946ce15e4a67bcbd1ffbeaec532763a.tar.bz2
ivy-league-a38e6d7cf946ce15e4a67bcbd1ffbeaec532763a.tar.xz
Added Forget
Diffstat (limited to 'dnn')
-rw-r--r--dnn/Reaction.cc27
1 files changed, 19 insertions, 8 deletions
diff --git a/dnn/Reaction.cc b/dnn/Reaction.cc
index 845d689..77dbb83 100644
--- a/dnn/Reaction.cc
+++ b/dnn/Reaction.cc
@@ -3,7 +3,7 @@
*
* by Stephane Chatty
*
- * Copyright 1993-1994
+ * Copyright 1993-1997
* Centre d'Etudes de la Navigation Aerienne (CENA)
*
* Reactions.
@@ -42,12 +42,23 @@ DnnBaseReaction :: ~DnnBaseReaction ()
(*ti)->Unsubscribe (*this);
}
+/*!
+Tell a reaction to forget a trigger. This special function is used only
+when destroying a trigger.
+!*/
+void
+DnnBaseReaction :: Forget (DnnTrigger& t)
+{
+ Triggers.Remove (&t);
+ Grabbed.Remove (&t);
+}
+
/*?nextdoc?*/
void
-DnnBaseReaction :: SubscribeTo (DnnTrigger& t)
+DnnBaseReaction :: SubscribeTo (DnnTrigger& t, REL_PRIORITY p)
{
Triggers.Append (&t);
- t.Subscribe (*this);
+ t.Subscribe (*this, (DnnTrigger::REL_PRIORITY) p);
}
/*?
@@ -90,8 +101,8 @@ DnnBaseReaction :: Manage (DnnEvent&)
{
}
-/*?class DnnReaction
-The class \typ{DnnReaction} is a ready-to-use derived class of \typ{DnnBaseReaction}.
+/*?class DnnCallback
+The class \typ{DnnCallback} is a ready-to-use derived class of \typ{DnnBaseReaction}.
In this class, the function \fun{Manage} is redefined to call a function passed when creating
the reaction.
?*/
@@ -100,20 +111,20 @@ the reaction.
Build a reaction that will call \var{f} to handle events.
\fun{f} has to take a \typ{DnnEvent\&} parameter and return \typ{void}.
?*/
-DnnReaction :: DnnReaction (DnnHandlingFunction f)
+DnnCallback :: DnnCallback (DnnHandlingFunction f)
: DnnBaseReaction (),
Handler (f)
{
}
/*?nodoc?*/
-DnnReaction :: ~DnnReaction ()
+DnnCallback :: ~DnnCallback ()
{
}
/*?nodoc?*/
void
-DnnReaction :: Manage (DnnEvent& ev)
+DnnCallback :: Manage (DnnEvent& ev)
{
(*Handler) (ev);
}