summaryrefslogtreecommitdiff
path: root/dnn/Trigger.cc
diff options
context:
space:
mode:
authorsc2000-11-28 14:52:16 +0000
committersc2000-11-28 14:52:16 +0000
commit3ee78810becfeeb3690468ac735b6ba20dc5c501 (patch)
tree4d2f3642e6ac53573a2721298dbc0c991216427b /dnn/Trigger.cc
parent7130702588fdc681f54f254bf378c07cd5392af7 (diff)
downloadivy-league-3ee78810becfeeb3690468ac735b6ba20dc5c501.zip
ivy-league-3ee78810becfeeb3690468ac735b6ba20dc5c501.tar.gz
ivy-league-3ee78810becfeeb3690468ac735b6ba20dc5c501.tar.bz2
ivy-league-3ee78810becfeeb3690468ac735b6ba20dc5c501.tar.xz
Integration into IvyLeague
Dnn -> Ivl Some class names changed, because of conflicts with previous Uch classes Imakefile is replaced with Makefile
Diffstat (limited to 'dnn/Trigger.cc')
-rw-r--r--dnn/Trigger.cc44
1 files changed, 21 insertions, 23 deletions
diff --git a/dnn/Trigger.cc b/dnn/Trigger.cc
index 3effd6d..f749b7d 100644
--- a/dnn/Trigger.cc
+++ b/dnn/Trigger.cc
@@ -16,11 +16,11 @@
#include "Reaction.h"
#include "Criterion.h"
-/*?class DnnTrigger
-\typ{DnnTrigger}s are the core of event detection and emission. The presence of a trigger
+/*?class IvlTrigger
+\typ{IvlTrigger}s are the core of event detection and emission. The presence of a trigger
(generally in a sensor) determines whether a certain situation, or the reception
of an event from the underlying window system, should provoke the emission of an event.
-Each trigger holds a list of reactions (of type \typ{DnnBaseReaction}). These reactions will
+Each trigger holds a list of reactions (of type \typ{IvlBaseReaction}). These reactions will
receive all the events whose creation and emission was caused by the presence of
the trigger.
?*/
@@ -28,7 +28,7 @@ the trigger.
/*?
Create a trigger with an empty list of associated reaction.
?*/
-DnnTrigger :: DnnTrigger ()
+IvlTrigger :: IvlTrigger ()
: FirstSubscribers (),
LastSubscribers (),
Subscribers (),
@@ -38,13 +38,13 @@ DnnTrigger :: DnnTrigger ()
}
/*?nodoc?*/
-DnnTrigger :: ~DnnTrigger ()
+IvlTrigger :: ~IvlTrigger ()
{
/* Force reactions to unsubscribe.
We should take care of conditions when destructor is called
during iteration */
- CcuListIterOf <DnnBaseReaction> ri = FirstSubscribers;
+ IvlListIterOf <IvlBaseReaction> ri = FirstSubscribers;
while (++ri)
(*ri)->Forget (*this);
ri = Subscribers;
@@ -60,7 +60,7 @@ DnnTrigger :: ~DnnTrigger ()
/*?nextdoc?*/
void
-DnnTrigger :: Subscribe (DnnBaseReaction& a, REL_PRIORITY p)
+IvlTrigger :: Subscribe (IvlBaseReaction& a, REL_PRIORITY p)
{
switch (p) {
case isFirstPriority:
@@ -80,7 +80,7 @@ Add (resp. Remove) a reaction to (resp. from) the list of reactions that should
events caused by this trigger.
?*/
void
-DnnTrigger :: Unsubscribe (DnnBaseReaction& a)
+IvlTrigger :: Unsubscribe (IvlBaseReaction& a)
{
FirstSubscribers.Remove (&a);
Subscribers.Remove (&a);
@@ -90,7 +90,7 @@ DnnTrigger :: Unsubscribe (DnnBaseReaction& a)
/*?nextdoc?*/
void
-DnnTrigger :: Grab (DnnBaseReaction& a)
+IvlTrigger :: Grab (IvlBaseReaction& a)
{
Grabs.Prepend (&a);
}
@@ -100,19 +100,19 @@ Add (resp. Remove) a reaction onto (resp. from) the stack of reactions that pree
events caused by this trigger.
?*/
void
-DnnTrigger :: Release (DnnBaseReaction& a)
+IvlTrigger :: Release (IvlBaseReaction& a)
{
Grabs.Remove (&a);
}
#if 0
void
-DnnTrigger :: Circulate (DnnBaseReaction& r, REL_POS pos, DnnBaseReaction* ref)
+IvlTrigger :: Circulate (IvlBaseReaction& r, REL_POS pos, IvlBaseReaction* ref)
{
if (Subscribers.Remove (&r)) {
/* find the predecessor of ref */
- CcuListIterOf <DnnBaseReaction> lc = Subscribers;
+ IvlListIterOf <IvlBaseReaction> lc = Subscribers;
while (++lc && (*lc != ref))
;
/* NOW, lc is on ref, or at the end if ref == 0 */
@@ -129,18 +129,18 @@ DnnTrigger :: Circulate (DnnBaseReaction& r, REL_POS pos, DnnBaseReaction* ref)
Have a trigger dispatch the event \var{ev} to its associated reactions.
?*/
void
-DnnTrigger :: Dispatch (DnnEvent& ev)
+IvlTrigger :: Dispatch (IvlEvent& ev)
{
- DnnBaseReaction* r = Grabs.First ();
+ IvlBaseReaction* r = Grabs.First ();
if (r) {
r->Manage (ev);
} else {
/* calls to Manage may result in changes in Subscribers; let's make a safe copy */
- CcuListOf <DnnBaseReaction> first_subscribers = FirstSubscribers;
- CcuListOf <DnnBaseReaction> subscribers = Subscribers;
- CcuListOf <DnnBaseReaction> last_subscribers = LastSubscribers;
+ IvlListOf <IvlBaseReaction> first_subscribers = FirstSubscribers;
+ IvlListOf <IvlBaseReaction> subscribers = Subscribers;
+ IvlListOf <IvlBaseReaction> last_subscribers = LastSubscribers;
- CcuListIterOf <DnnBaseReaction> s = first_subscribers;
+ IvlListIterOf <IvlBaseReaction> s = first_subscribers;
while (++s)
#ifdef CRITERIA_IN_REACTIONS
if ((*s)->Check (ev))
@@ -163,18 +163,16 @@ DnnTrigger :: Dispatch (DnnEvent& ev)
}
}
-
bool
-DnnTrigger :: Check (DnnEvent& ev)
+IvlTrigger :: Check (IvlEvent& ev)
{
- CcuListIterOf <DnnBaseCriterion> c = Criteria;
+ IvlListIterOf <IvlBaseCriterion> c = Criteria;
while (++c)
if (!(*c)->Test (ev))
return false;
-
#ifdef CRITERIA_IN_REACTIONS
- CcuListIterOf <DnnBaseReaction> ri = FirstSubscribers;
+ IvlListIterOf <IvlBaseReaction> ri = FirstSubscribers;
while (++ri)
if ((*ri)->Check (ev))
return true;