summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsc2000-11-28 14:52:16 +0000
committersc2000-11-28 14:52:16 +0000
commit3ee78810becfeeb3690468ac735b6ba20dc5c501 (patch)
tree4d2f3642e6ac53573a2721298dbc0c991216427b
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
-rwxr-xr-xdnn/Behaviour.cc56
-rwxr-xr-xdnn/Behaviour.h113
-rwxr-xr-xdnn/Criterion.cc67
-rwxr-xr-xdnn/Criterion.h95
-rwxr-xr-xdnn/Disposable.cc31
-rwxr-xr-xdnn/Disposable.h22
-rw-r--r--dnn/Event.cc58
-rw-r--r--dnn/Event.h73
-rw-r--r--dnn/Imakefile71
-rwxr-xr-xdnn/Loop.cc79
-rw-r--r--dnn/Loop.h71
-rw-r--r--dnn/Reaction.cc38
-rw-r--r--dnn/Reaction.h94
-rwxr-xr-xdnn/Source.cc79
-rwxr-xr-xdnn/Source.h72
-rw-r--r--dnn/Trigger.cc44
-rw-r--r--dnn/Trigger.h52
-rw-r--r--dnn/test.cc32
-rw-r--r--dnn/version.h9
19 files changed, 529 insertions, 627 deletions
diff --git a/dnn/Behaviour.cc b/dnn/Behaviour.cc
index 98a5b8d..a078c94 100755
--- a/dnn/Behaviour.cc
+++ b/dnn/Behaviour.cc
@@ -17,47 +17,47 @@
#include <stdio.h>
#include <stdlib.h>
-DnnToken :: DnnToken ()
+IvlToken :: IvlToken ()
{
}
-DnnToken :: ~DnnToken ()
+IvlToken :: ~IvlToken ()
{
}
-DnnState :: DnnState (const char* name)
+IvlState :: IvlState (const char* name)
: Name (name),
Transitions ()
{
}
-DnnState :: ~DnnState ()
+IvlState :: ~IvlState ()
{
- CcuListIterOf <DnnTransition> t = Transitions;
+ IvlListIterOf <IvlTransition> t = Transitions;
while (++t)
delete *t;
}
-DnnTransition*
-DnnState :: CreateTransition (const char* name, DnnState* s, DnnActivation* a, DnnAction* aa)
+IvlTransition*
+IvlState :: CreateTransition (const char* name, IvlState* s, IvlActivation* a, IvlAction* aa)
{
- DnnTransition* t = new DnnTransition (name, this, s, a, aa);
+ IvlTransition* t = new IvlTransition (name, this, s, a, aa);
Transitions.Append (t);
return t;
}
void
-DnnState :: Activate (DnnBehaviour* b, DnnToken* tk)
+IvlState :: Activate (IvlBehaviour* b, IvlToken* tk)
{
- CcuListIterOf <DnnTransition> t = Transitions;
+ IvlListIterOf <IvlTransition> t = Transitions;
while (++t) {
- DnnBehaviourReaction* r = new DnnBehaviourReaction (b, *t);
+ IvlBehaviourReaction* r = new IvlBehaviourReaction (b, *t);
(*t)->Activate (r, tk);
b->AddReaction (r);
}
}
-DnnTransition :: DnnTransition (const char* name, DnnState* from, DnnState* to, DnnActivation* a, DnnAction* aa)
+IvlTransition :: IvlTransition (const char* name, IvlState* from, IvlState* to, IvlActivation* a, IvlAction* aa)
: Name (name),
From (from),
To (to),
@@ -66,45 +66,45 @@ DnnTransition :: DnnTransition (const char* name, DnnState* from, DnnState* to,
{
}
-DnnTransition :: ~DnnTransition ()
+IvlTransition :: ~IvlTransition ()
{
}
void
-DnnTransition :: Activate (DnnBaseReaction* r, DnnToken* t)
+IvlTransition :: Activate (IvlBaseReaction* r, IvlToken* t)
{
(*Activation) (r, t);
}
-DnnState*
-DnnTransition :: Fire (DnnToken* tk, DnnEvent* ev)
+IvlState*
+IvlTransition :: Fire (IvlToken* tk, IvlEvent* ev)
{
(*Action) (tk, ev);
return To;
}
-DnnBehaviourModel :: DnnBehaviourModel ()
+IvlBehaviourModel :: IvlBehaviourModel ()
: Initial (0),
States ()
{
}
-DnnBehaviourModel :: ~DnnBehaviourModel ()
+IvlBehaviourModel :: ~IvlBehaviourModel ()
{
- CcuListIterOf <DnnState> s = States;
+ IvlListIterOf <IvlState> s = States;
while (++s)
delete *s;
}
-DnnState*
-DnnBehaviourModel :: CreateState (const char* name)
+IvlState*
+IvlBehaviourModel :: CreateState (const char* name)
{
- DnnState* s = new DnnState (name);
+ IvlState* s = new IvlState (name);
States.Append (s);
return s;
}
-DnnBehaviour :: DnnBehaviour (DnnBehaviourModel& m, DnnToken* tk)
+IvlBehaviour :: IvlBehaviour (IvlBehaviourModel& m, IvlToken* tk)
: TheModel (&m),
CurState (m.GetInitial ()),
CurReactions (),
@@ -114,7 +114,7 @@ DnnBehaviour :: DnnBehaviour (DnnBehaviourModel& m, DnnToken* tk)
}
void
-DnnBehaviour :: Fire (DnnTransition* t, DnnEvent* ev)
+IvlBehaviour :: Fire (IvlTransition* t, IvlEvent* ev)
{
/* check consistency */
if (CurState != t->GetOrigin ()) {
@@ -123,7 +123,7 @@ DnnBehaviour :: Fire (DnnTransition* t, DnnEvent* ev)
}
/* disactivate */
- DnnBaseReaction* r;
+ IvlBaseReaction* r;
while (r = CurReactions.RemoveFirst ())
delete r;
@@ -134,18 +134,18 @@ DnnBehaviour :: Fire (DnnTransition* t, DnnEvent* ev)
CurState->Activate (this, CurToken);
}
-DnnBehaviourReaction :: DnnBehaviourReaction (DnnBehaviour* b, DnnTransition* t)
+IvlBehaviourReaction :: IvlBehaviourReaction (IvlBehaviour* b, IvlTransition* t)
: TheBehaviour (b),
TheTransition (t)
{
}
-DnnBehaviourReaction :: ~DnnBehaviourReaction ()
+IvlBehaviourReaction :: ~IvlBehaviourReaction ()
{
}
void
-DnnBehaviourReaction :: Manage (DnnEvent& ev)
+IvlBehaviourReaction :: Manage (IvlEvent& ev)
{
TheBehaviour->Fire (TheTransition, &ev);
}
diff --git a/dnn/Behaviour.h b/dnn/Behaviour.h
index 2db049e..55fc8e5 100755
--- a/dnn/Behaviour.h
+++ b/dnn/Behaviour.h
@@ -12,93 +12,92 @@
* $CurLog$
*/
-#ifndef DnnBehaviour_H_
-#define DnnBehaviour_H_
+#ifndef IvlBehaviour_H_
+#define IvlBehaviour_H_
#include "cplus_bugs.h"
#include "Reaction.h"
-#include "ccu/String.h"
-#include "ccu/List.h"
+#include "ivl/String.h"
+#include "ivl/List.h"
-class DnnBehaviour;
-class DnnTransition;
-class DnnEvent;
+class IvlBehaviour;
+class IvlTransition;
+class IvlEvent;
-class DnnToken {
+class IvlToken {
public:
- DnnToken ();
-virtual ~DnnToken ();
+ IvlToken ();
+virtual ~IvlToken ();
};
-typedef void (DnnActivation) (DnnBaseReaction*, DnnToken*);
-typedef void (DnnAction) (DnnToken*, DnnEvent*);
+typedef void (IvlActivation) (IvlBaseReaction*, IvlToken*);
+typedef void (IvlAction) (IvlToken*, IvlEvent*);
-class DnnState {
+class IvlState {
protected:
- CcuString Name;
- CcuListOf <DnnTransition> Transitions;
+ IvlString Name;
+ IvlListOf <IvlTransition> Transitions;
public:
- DnnState (const char*);
- ~DnnState ();
- DnnTransition* CreateTransition (const char*, DnnState*, DnnActivation*, DnnAction*);
- void Activate (DnnBehaviour*, DnnToken*);
+ IvlState (const char*);
+ ~IvlState ();
+ IvlTransition* CreateTransition (const char*, IvlState*, IvlActivation*, IvlAction*);
+ void Activate (IvlBehaviour*, IvlToken*);
};
-class DnnTransition {
+class IvlTransition {
protected:
- CcuString Name;
- DnnState* From;
- DnnState* To;
- DnnActivation* Activation;
- DnnAction* Action;
+ IvlString Name;
+ IvlState* From;
+ IvlState* To;
+ IvlActivation* Activation;
+ IvlAction* Action;
public:
- DnnTransition (const char*, DnnState*, DnnState*, DnnActivation*, DnnAction*);
- ~DnnTransition ();
-inline DnnState* GetDestination () const { return To;}
-inline DnnState* GetOrigin () const { return From;}
- void Activate (DnnBaseReaction*, DnnToken*);
- DnnState* Fire (DnnToken*, DnnEvent*);
+ IvlTransition (const char*, IvlState*, IvlState*, IvlActivation*, IvlAction*);
+ ~IvlTransition ();
+inline IvlState* GetDestination () const { return To;}
+inline IvlState* GetOrigin () const { return From;}
+ void Activate (IvlBaseReaction*, IvlToken*);
+ IvlState* Fire (IvlToken*, IvlEvent*);
};
-
-class DnnBehaviourModel {
+class IvlBehaviourModel {
protected:
- DnnState* Initial;
- CcuListOf <DnnState> States;
+ IvlState* Initial;
+ IvlListOf <IvlState> States;
public:
- DnnBehaviourModel ();
- ~DnnBehaviourModel ();
-inline DnnState* GetInitial () const { return Initial; }
-inline void SetInitial (DnnState* s) { Initial = s; }
- DnnState* CreateState (const char* = 0);
+ IvlBehaviourModel ();
+ ~IvlBehaviourModel ();
+inline IvlState* GetInitial () const { return Initial; }
+inline void SetInitial (IvlState* s) { Initial = s; }
+ IvlState* CreateState (const char* = 0);
};
-class DnnBehaviour {
-friend class DnnBehaviourReaction;
+class IvlBehaviour {
+friend class IvlBehaviourReaction;
protected:
- DnnBehaviourModel* TheModel;
- DnnState* CurState;
- CcuListOf <DnnBaseReaction> CurReactions;
- DnnToken* CurToken;
- void Fire (DnnTransition*, DnnEvent*);
+ IvlBehaviourModel* TheModel;
+ IvlState* CurState;
+ IvlListOf <IvlBaseReaction> CurReactions;
+ IvlToken* CurToken;
+ void Fire (IvlTransition*, IvlEvent*);
public:
- DnnBehaviour (DnnBehaviourModel&, DnnToken*);
- ~DnnBehaviour ();
-inline void AddReaction (DnnBaseReaction* r) { CurReactions.Append (r); }
+ IvlBehaviour (IvlBehaviourModel&, IvlToken*);
+ ~IvlBehaviour ();
+inline void AddReaction (IvlBaseReaction* r) { CurReactions.Append (r); }
};
-class DnnBehaviourReaction : public DnnBaseReaction {
+class IvlBehaviourReaction : public IvlBaseReaction {
protected:
- DnnBehaviour* TheBehaviour;
- DnnTransition* TheTransition;
+ IvlBehaviour* TheBehaviour;
+ IvlTransition* TheTransition;
public:
- DnnBehaviourReaction (DnnBehaviour*, DnnTransition*);
- ~DnnBehaviourReaction ();
- void Manage (DnnEvent&);
+ IvlBehaviourReaction (IvlBehaviour*, IvlTransition*);
+ ~IvlBehaviourReaction ();
+ void Manage (IvlEvent&);
};
-#endif /* DnnBehaviour_H_ */
+#endif /* IvlBehaviour_H_ */
diff --git a/dnn/Criterion.cc b/dnn/Criterion.cc
index edef576..d5ac1f6 100755
--- a/dnn/Criterion.cc
+++ b/dnn/Criterion.cc
@@ -14,53 +14,52 @@
#include "Criterion.h"
-DnnBaseCriterion :: DnnBaseCriterion ()
+IvlBaseCriterion :: IvlBaseCriterion ()
{
}
-DnnBaseCriterion :: ~DnnBaseCriterion ()
+IvlBaseCriterion :: ~IvlBaseCriterion ()
{
}
-
-DnnAndCriterion :: DnnAndCriterion ()
-: DnnBaseCriterion (),
+IvlAndCriterion :: IvlAndCriterion ()
+: IvlBaseCriterion (),
Conditions ()
{
}
-DnnAndCriterion :: ~DnnAndCriterion ()
+IvlAndCriterion :: ~IvlAndCriterion ()
{
}
-DnnAndCriterion&
-DnnAndCriterion :: operator &= (DnnBaseCriterion& b)
+IvlAndCriterion&
+IvlAndCriterion :: operator &= (IvlBaseCriterion& b)
{
Conditions.Append (&b);
return *this;
}
-DnnAndCriterion&
-DnnAndCriterion :: operator &= (DnnOrCriterion& b)
+IvlAndCriterion&
+IvlAndCriterion :: operator &= (IvlOrCriterion& b)
{
Conditions.Append (&b);
return *this;
}
-DnnAndCriterion&
-DnnAndCriterion :: operator &= (DnnAndCriterion& b)
+IvlAndCriterion&
+IvlAndCriterion :: operator &= (IvlAndCriterion& b)
{
- CcuListIterOf <DnnBaseCriterion> li = b.Conditions;
+ IvlListIterOf <IvlBaseCriterion> li = b.Conditions;
while (++li)
Conditions.Append (*li);
return *this;
}
bool
-DnnAndCriterion :: Test (DnnEvent& ev)
+IvlAndCriterion :: Test (IvlEvent& ev)
{
bool res = true;
- CcuListIterOf <DnnBaseCriterion> li = Conditions;
+ IvlListIterOf <IvlBaseCriterion> li = Conditions;
while (res && ++li)
#ifdef CPLUS_BUG22
res = bool (res && (*li)->Test (ev));
@@ -70,45 +69,44 @@ DnnAndCriterion :: Test (DnnEvent& ev)
return res;
}
-
-DnnOrCriterion :: DnnOrCriterion ()
-: DnnBaseCriterion (),
+IvlOrCriterion :: IvlOrCriterion ()
+: IvlBaseCriterion (),
Alternatives ()
{
}
-DnnOrCriterion :: ~DnnOrCriterion ()
+IvlOrCriterion :: ~IvlOrCriterion ()
{
}
-DnnOrCriterion&
-DnnOrCriterion :: operator |= (DnnOrCriterion& b)
+IvlOrCriterion&
+IvlOrCriterion :: operator |= (IvlOrCriterion& b)
{
- CcuListIterOf <DnnBaseCriterion> li = b.Alternatives;
+ IvlListIterOf <IvlBaseCriterion> li = b.Alternatives;
while (++li)
Alternatives.Append (*li);
return *this;
}
-DnnOrCriterion&
-DnnOrCriterion :: operator |= (DnnBaseCriterion& b)
+IvlOrCriterion&
+IvlOrCriterion :: operator |= (IvlBaseCriterion& b)
{
Alternatives.Append (&b);
return *this;
}
-DnnOrCriterion&
-DnnOrCriterion :: operator |= (DnnAndCriterion& b)
+IvlOrCriterion&
+IvlOrCriterion :: operator |= (IvlAndCriterion& b)
{
Alternatives.Append (&b);
return *this;
}
bool
-DnnOrCriterion :: Test (DnnEvent& ev)
+IvlOrCriterion :: Test (IvlEvent& ev)
{
bool res = false;
- CcuListIterOf <DnnBaseCriterion> li = Alternatives;
+ IvlListIterOf <IvlBaseCriterion> li = Alternatives;
while (!res && ++li)
#ifdef CPLUS_BUG22
res = bool (res || (*li)->Test (ev));
@@ -118,25 +116,24 @@ DnnOrCriterion :: Test (DnnEvent& ev)
return res;
}
-
-DnnBasicCriterion :: DnnBasicCriterion ()
-: DnnBaseCriterion (),
+IvlBasicCriterion :: IvlBasicCriterion ()
+: IvlBaseCriterion (),
Check (0)
{
}
-DnnBasicCriterion :: DnnBasicCriterion (bool (*c) (DnnEvent&))
-: DnnBaseCriterion (),
+IvlBasicCriterion :: IvlBasicCriterion (bool (*c) (IvlEvent&))
+: IvlBaseCriterion (),
Check (c)
{
}
-DnnBasicCriterion :: ~DnnBasicCriterion ()
+IvlBasicCriterion :: ~IvlBasicCriterion ()
{
}
bool
-DnnBasicCriterion :: Test (DnnEvent& e)
+IvlBasicCriterion :: Test (IvlEvent& e)
{
return Check ? (*Check) (e) : false;
}
diff --git a/dnn/Criterion.h b/dnn/Criterion.h
index 92dd48a..e878ddf 100755
--- a/dnn/Criterion.h
+++ b/dnn/Criterion.h
@@ -10,94 +10,93 @@
*
* $Id$
* $CurLog$
- * Removed pragma interfaces
*/
-#ifndef DnnCriterion_H_
-#define DnnCriterion_H_
+#ifndef IvlCriterion_H_
+#define IvlCriterion_H_
#include "cplus_bugs.h"
-#include "ccu/bool.h"
-#include "ccu/List.h"
-class DnnEvent;
+#include "ivl/bool.h"
+#include "ivl/List.h"
+class IvlEvent;
-class DnnBaseCriterion {
-friend class DnnAndCriterion;
-friend class DnnOrCriterion;
+class IvlBaseCriterion {
+friend class IvlAndCriterion;
+friend class IvlOrCriterion;
protected:
- DnnBaseCriterion ();
- ~DnnBaseCriterion ();
+ IvlBaseCriterion ();
+ ~IvlBaseCriterion ();
public:
-virtual bool Test (DnnEvent&) = 0;
+virtual bool Test (IvlEvent&) = 0;
};
-class DnnOrCriterion;
+class IvlOrCriterion;
-class DnnAndCriterion : public DnnBaseCriterion {
-friend class DnnOrCriterion;
+class IvlAndCriterion : public IvlBaseCriterion {
+friend class IvlOrCriterion;
protected:
- CcuListOf <DnnBaseCriterion> Conditions;
- bool Test (DnnEvent&);
+ IvlListOf <IvlBaseCriterion> Conditions;
+ bool Test (IvlEvent&);
public:
- DnnAndCriterion ();
- ~DnnAndCriterion ();
- DnnAndCriterion& operator &= (DnnBaseCriterion&);
- DnnAndCriterion& operator &= (DnnOrCriterion&);
- DnnAndCriterion& operator &= (DnnAndCriterion&);
+ IvlAndCriterion ();
+ ~IvlAndCriterion ();
+ IvlAndCriterion& operator &= (IvlBaseCriterion&);
+ IvlAndCriterion& operator &= (IvlOrCriterion&);
+ IvlAndCriterion& operator &= (IvlAndCriterion&);
};
-class DnnOrCriterion : public DnnBaseCriterion {
-friend class DnnAndCriterion;
+class IvlOrCriterion : public IvlBaseCriterion {
+friend class IvlAndCriterion;
protected:
- CcuListOf <DnnBaseCriterion> Alternatives;
- bool Test (DnnEvent&);
+ IvlListOf <IvlBaseCriterion> Alternatives;
+ bool Test (IvlEvent&);
public:
- DnnOrCriterion ();
- ~DnnOrCriterion ();
- DnnOrCriterion& operator |= (DnnBaseCriterion&);
- DnnOrCriterion& operator |= (DnnOrCriterion&);
- DnnOrCriterion& operator |= (DnnAndCriterion&);
+ IvlOrCriterion ();
+ ~IvlOrCriterion ();
+ IvlOrCriterion& operator |= (IvlBaseCriterion&);
+ IvlOrCriterion& operator |= (IvlOrCriterion&);
+ IvlOrCriterion& operator |= (IvlAndCriterion&);
};
-class DnnBasicCriterion : public DnnBaseCriterion {
+class IvlBasicCriterion : public IvlBaseCriterion {
protected:
- bool (*Check) (DnnEvent&);
- bool Test (DnnEvent& e);
+ bool (*Check) (IvlEvent&);
+ bool Test (IvlEvent& e);
public:
- DnnBasicCriterion ();
- DnnBasicCriterion (bool (*c) (DnnEvent&));
- ~DnnBasicCriterion ();
-inline void ChangeCriterion (bool (*c) (DnnEvent&)) {Check = c; }
+ IvlBasicCriterion ();
+ IvlBasicCriterion (bool (*c) (IvlEvent&));
+ ~IvlBasicCriterion ();
+inline void ChangeCriterion (bool (*c) (IvlEvent&)) {Check = c; }
};
-template <class T> class DnnCriterionOf : public DnnBaseCriterion {
+template <class T> class IvlCriterionOf : public IvlBaseCriterion {
protected:
T& Object;
- void (T::*Check) (DnnEvent&);
+ void (T::*Check) (IvlEvent&);
public:
- DnnCriterionOf (T& o, void (T::*c) (DnnEvent&)) : DnnBaseCriterion (), Object (o), Check (c) {}
- ~DnnCriterionOf () {}
- bool Test (DnnEvent& ev) { return (Object.*Check) (ev); }
+ IvlCriterionOf (T& o, void (T::*c) (IvlEvent&)) : IvlBaseCriterion (), Object (o), Check (c) {}
+ ~IvlCriterionOf () {}
+ bool Test (IvlEvent& ev) { return (Object.*Check) (ev); }
};
#define SpecializedCriterion(R,S) \
\
-class R : public DnnBaseCriterion { \
+class R : public IvlBaseCriterion { \
\
protected: \
\
S& Body; \
- bool (S::*SpecializedCheck) (DnnEvent&); \
+ bool (S::*SpecializedCheck) (IvlEvent&); \
\
public: \
\
- R (S& s, bool (S::*sc) (DnnEvent&)) : DnnBaseCriterion (), Body (s), SpecializedCheck (sc) {} \
+ R (S& s, bool (S::*sc) (IvlEvent&)) : IvlBaseCriterion (), Body (s), SpecializedCheck (sc) {} \
~R () {} \
\
- bool Test (DnnEvent& e) { return (Body.*SpecializedCheck) (e); } \
+ bool Test (IvlEvent& e) { return (Body.*SpecializedCheck) (e); } \
\
};
-#endif /* DnnCriterion_H_ */
+#endif /* IvlCriterion_H_ */
diff --git a/dnn/Disposable.cc b/dnn/Disposable.cc
index 4e8a03a..041931b 100755
--- a/dnn/Disposable.cc
+++ b/dnn/Disposable.cc
@@ -15,33 +15,32 @@
#include "Disposable.h"
#include "Loop.h"
-bool DnnDisposable::ClassInitialized = false;
-CcuInitializerFor<DnnBaseMultiplexer> DnnDisposable::Dependance;
-CcuInitializerFor<DnnDisposable> DnnDisposable::Initializer;
-CcuListOf<DnnDisposable> DnnDisposable::Garbage;
+bool IvlDisposable::ClassInitialized = false;
+IvlInitializerFor<IvlBaseMultiplexer> IvlDisposable::Dependance;
+IvlInitializerFor<IvlDisposable> IvlDisposable::Initializer;
+IvlListOf<IvlDisposable> IvlDisposable::Garbage;
void
-DnnDisposable :: ClassInit ()
+IvlDisposable :: ClassInit ()
{
if (!ClassInitialized) {
ClassInitialized = true;
- DnnBaseMultiplexer::AddGlobalHook (&DnnDisposable::DeleteGarbage, true);
+ IvlBaseMultiplexer::AddGlobalHook (&IvlDisposable::DeleteGarbage, true);
}
}
#if 0
void
-DnnDisposable :: ClassClose ()
+IvlDisposable :: ClassClose ()
{
- DnnBaseMultiplexer::RemoveGlobalHook (&DnnDisposable::DeleteGarbage);
+ IvlBaseMultiplexer::RemoveGlobalHook (&IvlDisposable::DeleteGarbage);
}
#endif
-
/*?
-\typ{DnnDisposable} objects are objects whose deletion is called in a safe
+\typ{IvlDisposable} objects are objects whose deletion is called in a safe
place in an asynchronous way.
-Instances of derived class of DnnDisposable which are to be deleted
+Instances of derived class of IvlDisposable which are to be deleted
asynchronously must be allocated only dynamically with new.
An instance is put into it's class garbage list (and thus deleted)
@@ -52,16 +51,16 @@ a deletion while in an unsafe state.
Typically this class is to be used by derivation of UchChannel
which can be deleted from within themselves after a call to \fun{HandleRead}.
?*/
-DnnDisposable :: DnnDisposable ()
+IvlDisposable :: IvlDisposable ()
{
}
-DnnDisposable :: ~DnnDisposable ()
+IvlDisposable :: ~IvlDisposable ()
{
}
void
-DnnDisposable :: Trash ()
+IvlDisposable :: Trash ()
{
Garbage.Append (this);
};
@@ -70,9 +69,9 @@ DnnDisposable :: Trash ()
Delete all the instances which are in the garbage list.
?*/
void
-DnnDisposable :: DeleteGarbage ()
+IvlDisposable :: DeleteGarbage ()
{
- DnnDisposable* d;
+ IvlDisposable* d;
while (d = Garbage.RemoveFirst ())
delete d;
}
diff --git a/dnn/Disposable.h b/dnn/Disposable.h
index e6f10f7..1f73380 100755
--- a/dnn/Disposable.h
+++ b/dnn/Disposable.h
@@ -12,34 +12,34 @@
* $CurLog$
*/
-#ifndef DnnDisposable_H_
-#define DnnDisposable_H_
+#ifndef IvlDisposable_H_
+#define IvlDisposable_H_
-#include "ccu/List.h"
-#include "ccu/Initializer.h"
+#include "ivl/List.h"
+#include "ivl/Initializer.h"
#include "Loop.h"
-class DnnDisposable {
+class IvlDisposable {
public:
static bool ClassInitialized;
static void ClassInit ();
-static CcuInitializerFor <DnnDisposable> Initializer;
+static IvlInitializerFor <IvlDisposable> Initializer;
protected:
-static CcuListOf <DnnDisposable> Garbage;
+static IvlListOf <IvlDisposable> Garbage;
private:
-static CcuInitializerFor <DnnBaseMultiplexer> Dependance;
+static IvlInitializerFor <IvlBaseMultiplexer> Dependance;
protected:
- DnnDisposable ();
+ IvlDisposable ();
public:
-virtual ~DnnDisposable ();
+virtual ~IvlDisposable ();
void Trash ();
static void DeleteGarbage ();
};
-#endif /* DnnDisposable_H_ */
+#endif /* IvlDisposable_H_ */
diff --git a/dnn/Event.cc b/dnn/Event.cc
index 600b174..b231e4e 100644
--- a/dnn/Event.cc
+++ b/dnn/Event.cc
@@ -15,43 +15,42 @@
#include "Event.h"
#include <memory.h>
-DnnEventFeatureList :: DnnEventFeatureList (const DnnEventFeatureList& base, int nbf, DnnEventFeature* f)
-: CcuListOf <DnnEventFeature> (base)
+IvlEventFeatureList :: IvlEventFeatureList (const IvlEventFeatureList& base, int nbf, IvlEventFeature* f)
+: IvlListOf <IvlEventFeature> (base)
{
Load (nbf, f);
}
-DnnEventFeatureList :: DnnEventFeatureList (int nbf, DnnEventFeature* f)
-: CcuListOf <DnnEventFeature> ()
+IvlEventFeatureList :: IvlEventFeatureList (int nbf, IvlEventFeature* f)
+: IvlListOf <IvlEventFeature> ()
{
Load (nbf, f);
}
void
-DnnEventFeatureList :: Load (int nbf, DnnEventFeature* f)
+IvlEventFeatureList :: Load (int nbf, IvlEventFeature* f)
{
while (nbf-- > 0)
Append (f++);
}
-DnnEventFeatureList :: ~DnnEventFeatureList ()
+IvlEventFeatureList :: ~IvlEventFeatureList ()
{
}
-
-/*?class DnnEventType
-A \typ{DnnEventType} contains the description of a -- dynamic -- class of events.
+/*?class IvlEventType
+A \typ{IvlEventType} contains the description of a -- dynamic -- class of events.
It holds a name and an array of offsets, each describing where to find the corresponding
feature in an event of that class.
?*/
-CcuListOf <DnnEventType>* DnnEventType::AllTypes = 0;
+IvlListOf <IvlEventType>* IvlEventType::AllTypes = 0;
/*?hidden?*/
void
-DnnEventType :: ClassInit ()
+IvlEventType :: ClassInit ()
{
- AllTypes = new CcuListOf <DnnEventType>;
+ AllTypes = new IvlListOf <IvlEventType>;
}
/*?
@@ -59,7 +58,7 @@ Build an event type named \var{name} from an array of features. This is mostly
useful for statically defined event classes. \var{f} is the array of features, and
\var{nbf} is the number of features in that array.
?*/
-DnnEventType :: DnnEventType (const char* name, int nbf, DnnEventFeature f [])
+IvlEventType :: IvlEventType (const char* name, int nbf, IvlEventFeature f [])
: Name (name),
#if 0
Features (),
@@ -80,7 +79,7 @@ DnnEventType :: DnnEventType (const char* name, int nbf, DnnEventFeature f [])
/*?
Build an event type from a list of features.
?*/
-DnnEventType :: DnnEventType (const char* name, const DnnEventFeatureList& fl)
+IvlEventType :: IvlEventType (const char* name, const IvlEventFeatureList& fl)
: Name (name),
#if 0
Features (),
@@ -93,7 +92,7 @@ DnnEventType :: DnnEventType (const char* name, const DnnEventFeatureList& fl)
AllTypes->Append (this);
int offset = 0;
int i = 0;
- CcuListIterOf <DnnEventFeature> f = fl;
+ IvlListIterOf <IvlEventFeature> f = fl;
while (++f) {
offset += (*f)->Size;
FeaturesOffsets [i] = offset;
@@ -102,31 +101,30 @@ DnnEventType :: DnnEventType (const char* name, const DnnEventFeatureList& fl)
}
/*?nodoc?*/
-DnnEventType :: ~DnnEventType ()
+IvlEventType :: ~IvlEventType ()
{
AllTypes->Remove (this);
delete [] FeaturesOffsets;
}
-DnnEvent :: DnnEvent ()
+IvlEvent :: IvlEvent ()
{
}
/* useless, for compatibility only */
-DnnEvent :: DnnEvent (const DnnEventType*)
+IvlEvent :: IvlEvent (const IvlEventType*)
{
}
-DnnEvent :: ~DnnEvent ()
+IvlEvent :: ~IvlEvent ()
{
}
-
/*?
Build an event of type \var{t}.
?*/
-DnnBasicEvent :: DnnBasicEvent (const DnnEventType* t)
-: DnnEvent (),
+IvlBasicEvent :: IvlBasicEvent (const IvlEventType* t)
+: IvlEvent (),
Type (*t)
{
int sz = t->GetTotalSize ();
@@ -136,9 +134,8 @@ DnnBasicEvent :: DnnBasicEvent (const DnnEventType* t)
Data = 0;
}
-
-DnnBasicEvent :: DnnBasicEvent (const DnnEventType* t, bool alloc)
-: DnnEvent (),
+IvlBasicEvent :: IvlBasicEvent (const IvlEventType* t, bool alloc)
+: IvlEvent (),
Type (*t)
{
if (alloc) {
@@ -153,14 +150,14 @@ DnnBasicEvent :: DnnBasicEvent (const DnnEventType* t, bool alloc)
}
/*?nodoc?*/
-DnnBasicEvent :: ~DnnBasicEvent ()
+IvlBasicEvent :: ~IvlBasicEvent ()
{
if (Data && Data != (char*) (&Data+sizeof (char*)))
delete [] Data;
}
void
-DnnBasicEvent :: SetFeature (int i, const void* data)
+IvlBasicEvent :: SetFeature (int i, const void* data)
{
int offset = Type.GetOffset (i);
int size = Type.GetSize (i);
@@ -168,7 +165,7 @@ DnnBasicEvent :: SetFeature (int i, const void* data)
}
void
-DnnBasicEvent :: GetFeature (int i, void* data)
+IvlBasicEvent :: GetFeature (int i, void* data)
{
int offset = Type.GetOffset (i);
int size = Type.GetSize (i);
@@ -177,18 +174,17 @@ DnnBasicEvent :: GetFeature (int i, void* data)
#if 0
void
-DnnBasicEvent :: WriteTo (DnnIOS& s)
+IvlBasicEvent :: WriteTo (IvlIOS& s)
{
// what about byte swapping?
s.WriteBuf ((const byte*) Data, Type.GetTotalSize ());
}
void
-DnnBasicEvent :: ReadFrom (DnnIOS& s, lword)
+IvlBasicEvent :: ReadFrom (IvlIOS& s, lword)
{
// what about byte swapping?
s.ReadBuf ((byte*) Data, Type.GetTotalSize ());
}
-
#endif
diff --git a/dnn/Event.h b/dnn/Event.h
index b2c7341..3b9ac6b 100644
--- a/dnn/Event.h
+++ b/dnn/Event.h
@@ -10,95 +10,94 @@
*
* $Id$
* $CurLog$
- * Split DnnEvent into DnnEvent and DnnBasicEvent
*/
-#ifndef DnnEvent_H_
-#define DnnEvent_H_
+#ifndef IvlEvent_H_
+#define IvlEvent_H_
#include "cplus_bugs.h"
-#include "ccu/String.h"
-#include "ccu/List.h"
-#include "ccu/bool.h"
+#include "ivl/String.h"
+#include "ivl/List.h"
+#include "ivl/bool.h"
#if 0
-class DnnEventFeature {
+class IvlEventFeature {
protected:
- CcuString Name;
- DnnEventFeatureType& Type;
+ IvlString Name;
+ IvlEventFeatureType& Type;
public:
-inline DnnEventFeature (const char* n, DnnEventFeatureType& t) : Name (n), Type (t) {}
-inline ~DnnEventFeature () {}
+inline IvlEventFeature (const char* n, IvlEventFeatureType& t) : Name (n), Type (t) {}
+inline ~IvlEventFeature () {}
};
#else
-struct DnnEventFeature {
+struct IvlEventFeature {
const char* Name;
int Size;
};
#endif
-class DnnEventFeatureList : public CcuListOf <DnnEventFeature> {
+class IvlEventFeatureList : public IvlListOf <IvlEventFeature> {
private:
- void Load (int, DnnEventFeature*);
+ void Load (int, IvlEventFeature*);
public:
- DnnEventFeatureList (int, DnnEventFeature*);
- DnnEventFeatureList (const DnnEventFeatureList&, int, DnnEventFeature*);
- ~DnnEventFeatureList ();
+ IvlEventFeatureList (int, IvlEventFeature*);
+ IvlEventFeatureList (const IvlEventFeatureList&, int, IvlEventFeature*);
+ ~IvlEventFeatureList ();
};
-class DnnEventType {
+class IvlEventType {
private:
static void ClassInit ();
protected:
-static CcuListOf <DnnEventType>* AllTypes;
- CcuString Name;
+static IvlListOf <IvlEventType>* AllTypes;
+ IvlString Name;
#if 0
- CcuListOf <DnnEventFeature> Features;
+ IvlListOf <IvlEventFeature> Features;
#endif
int NbFeatures;
int* FeaturesOffsets;
public:
- DnnEventType (const char*, int, DnnEventFeature []);
- DnnEventType (const char*, const DnnEventFeatureList&);
- ~DnnEventType ();
-inline int operator == (const DnnEventType& evt) const { return (this == &evt); }
+ IvlEventType (const char*, int, IvlEventFeature []);
+ IvlEventType (const char*, const IvlEventFeatureList&);
+ ~IvlEventType ();
+inline int operator == (const IvlEventType& evt) const { return (this == &evt); }
inline const char* GetName () const { return Name; }
inline int GetTotalSize () const { return (NbFeatures) > 0 ? FeaturesOffsets [NbFeatures - 1] : 0; }
inline int GetOffset (int i) const { return i ? FeaturesOffsets [i-1] : 0; }
inline int GetSize (int i) const { return FeaturesOffsets [i] - (i ? FeaturesOffsets [i-1] : 0); }
#if 0
-inline void AddFeature (const char* fn, DnnEventFeatureType& t) { Features->Append (new DnnEventFeature (fn, t); }
+inline void AddFeature (const char* fn, IvlEventFeatureType& t) { Features->Append (new IvlEventFeature (fn, t); }
inline void RemoveFeature () { }
#endif
};
-class DnnEvent {
+class IvlEvent {
public:
- DnnEvent ();
- DnnEvent (const DnnEventType*); // useless, for compatibility only
-virtual ~DnnEvent ();
+ IvlEvent ();
+ IvlEvent (const IvlEventType*); // useless, for compatibility only
+virtual ~IvlEvent ();
};
-class DnnBasicEvent : public DnnEvent {
+class IvlBasicEvent : public IvlEvent {
protected:
- const DnnEventType& Type;
+ const IvlEventType& Type;
char* Data;
- DnnBasicEvent (const DnnEventType*, bool);
+ IvlBasicEvent (const IvlEventType*, bool);
public:
- DnnBasicEvent (const DnnEventType*);
- ~DnnBasicEvent ();
+ IvlBasicEvent (const IvlEventType*);
+ ~IvlBasicEvent ();
void SetFeature (int, const void*);
void GetFeature (int, void*);
-inline const DnnEventType* GetType () const { return &Type; }
+inline const IvlEventType* GetType () const { return &Type; }
};
-#endif /* DnnEvent_H_ */
+#endif /* IvlEvent_H_ */
diff --git a/dnn/Imakefile b/dnn/Imakefile
deleted file mode 100644
index 4160117..0000000
--- a/dnn/Imakefile
+++ /dev/null
@@ -1,71 +0,0 @@
-#
-# DNN - Data News Network
-#
-# by Stephane Chatty
-#
-# Copyright 1993-1996
-# Centre d'Etudes de la Navigation Aerienne (CENA)
-#
-# Imakefile
-#
-# $Id$
-# $CurLog$
-#
-
- CXXFLAGS = $(CXXOPTIONS) -I$(LOCINCL)
-
- OBJ = Event.o Criterion.o Trigger.o Reaction.o Source.o Behaviour.o\
- Disposable.o Loop.o
-
-
- cc = $(CXXSUFFIX)
- SRC = Event.$(cc) Criterion.$(cc) Trigger.$(cc) Reaction.$(cc) Source.$(cc) Behaviour.$(cc)
-
- HDR = Event.h Criterion.h Reaction.h Trigger.h Source.h Behaviour.h Loop.h
-
-
- LLIB =
- DOC = ../../DOC/DNN
-
-CxxRule ()
-
-all : $(LOCLIB)/libDnn.a $(LOCINCL)/dnn.h headers
-
-headers: incldir \
- $(LOCINCL)/dnn/Event.h \
- $(LOCINCL)/dnn/Criterion.h \
- $(LOCINCL)/dnn/Reaction.h \
- $(LOCINCL)/dnn/Trigger.h \
- $(LOCINCL)/dnn/Source.h \
- $(LOCINCL)/dnn/Loop.h \
- $(LOCINCL)/dnn/Behaviour.h
-
-incldir:
- -mkdir $(LOCINCL)/dnn
-
- CCUHDR = $(LOCINCL)/ccu/List.h \
- $(LOCINCL)/ccu/String.h \
- $(LOCINCL)/ccu/bool.h \
- $(LOCINCL)/ccu/HashTable.h \
- $(LOCINCL)/ccu/Automaton.h
-
- LLIB = $(LOCLIB)/libCcu.a
-
-
-InstallLibsTarget ($(LOCLIB),Dnn)
-InstallTarget ($(LOCINCL)/dnn.h, dnn.h)
-InstallTarget ($(LOCINCL)/dnn/Criterion.h, Criterion.h)
-InstallTarget ($(LOCINCL)/dnn/Event.h, Event.h)
-InstallTarget ($(LOCINCL)/dnn/Trigger.h, Trigger.h)
-InstallTarget ($(LOCINCL)/dnn/Reaction.h, Reaction.h)
-InstallTarget ($(LOCINCL)/dnn/Source.h, Source.h)
-InstallTarget ($(LOCINCL)/dnn/Behaviour.h, Behaviour.h)
-InstallTarget ($(LOCINCL)/dnn/Loop.h, Loop.h)
-
-GenHeaderTarget (dnn.h, version.h $(CCUHDR) $(HDR))
-LibraryTarget (Dnn,$(OBJ))
-
-ProgramTarget(test, test.o $(OBJ),)
-DocRule("Data News Network")
-TeXRule()
-DistrDocRule(DNN)
diff --git a/dnn/Loop.cc b/dnn/Loop.cc
index a655e8b..472457a 100755
--- a/dnn/Loop.cc
+++ b/dnn/Loop.cc
@@ -14,24 +14,24 @@
#include "Loop.h"
-CcuInitializerFor<DnnBaseMultiplexer> DnnBaseMultiplexer::Initializer;
-bool DnnBaseMultiplexer::ClassInitialized = false;
-CcuList* DnnBaseMultiplexer::GlobalHooks = 0;
-CcuList* DnnBaseMultiplexer::GlobalFinalHooks = 0;
-DnnBaseMultiplexer* DnnMpx = 0;
+IvlInitializerFor<IvlBaseMultiplexer> IvlBaseMultiplexer::Initializer;
+bool IvlBaseMultiplexer::ClassInitialized = false;
+IvlList* IvlBaseMultiplexer::GlobalHooks = 0;
+IvlList* IvlBaseMultiplexer::GlobalFinalHooks = 0;
+IvlBaseMultiplexer* IvlMpx = 0;
void
-DnnBaseMultiplexer :: ClassInit ()
+IvlBaseMultiplexer :: ClassInit ()
{
if (!ClassInitialized) {
ClassInitialized = true;
- GlobalHooks = new CcuList;
- GlobalFinalHooks = new CcuList;
+ GlobalHooks = new IvlList;
+ GlobalFinalHooks = new IvlList;
}
}
void
-DnnBaseMultiplexer :: AddGlobalHook (DnnMpxHook* h, bool final)
+IvlBaseMultiplexer :: AddGlobalHook (IvlMpxHook* h, bool final)
{
GlobalHooks->Append ((void*) h);
if (final)
@@ -39,43 +39,41 @@ DnnBaseMultiplexer :: AddGlobalHook (DnnMpxHook* h, bool final)
}
void
-DnnBaseMultiplexer :: RemoveGlobalHook (DnnMpxHook* h, bool final)
+IvlBaseMultiplexer :: RemoveGlobalHook (IvlMpxHook* h, bool final)
{
GlobalHooks->Remove ((void*) h);
if (final)
GlobalFinalHooks->Remove ((void*) h);
}
-
-DnnBaseMultiplexer :: DnnBaseMultiplexer ()
+IvlBaseMultiplexer :: IvlBaseMultiplexer ()
{
}
-DnnBaseMultiplexer :: ~DnnBaseMultiplexer ()
+IvlBaseMultiplexer :: ~IvlBaseMultiplexer ()
{
}
/* useless? */
MPX_RES
-DnnBaseMultiplexer :: Run ()
+IvlBaseMultiplexer :: Run ()
{
return Loop ();
}
-
-DnnMultiplexer :: DnnMultiplexer ()
-: DnnBaseMultiplexer (),
+IvlMultiplexer :: IvlMultiplexer ()
+: IvlBaseMultiplexer (),
Hooks (),
FinalHooks ()
{
}
-DnnMultiplexer :: ~DnnMultiplexer ()
+IvlMultiplexer :: ~IvlMultiplexer ()
{
}
void
-DnnMultiplexer :: AddHook (DnnMpxHook* h, bool final)
+IvlMultiplexer :: AddHook (IvlMpxHook* h, bool final)
{
Hooks.Append ((void*) h);
if (final)
@@ -83,7 +81,7 @@ DnnMultiplexer :: AddHook (DnnMpxHook* h, bool final)
}
void
-DnnMultiplexer :: RemoveHook (DnnMpxHook* h, bool final)
+IvlMultiplexer :: RemoveHook (IvlMpxHook* h, bool final)
{
Hooks.Remove ((void*) h);
if (final)
@@ -91,31 +89,30 @@ DnnMultiplexer :: RemoveHook (DnnMpxHook* h, bool final)
}
void
-DnnMultiplexer :: AddFinalHook (DnnMpxHook* h)
+IvlMultiplexer :: AddFinalHook (IvlMpxHook* h)
{
FinalHooks.Append ((void*) h);
}
void
-DnnMultiplexer :: RemoveFinalHook (DnnMpxHook* h)
+IvlMultiplexer :: RemoveFinalHook (IvlMpxHook* h)
{
FinalHooks.Remove ((void*) h);
}
-
void
-DnnMultiplexer :: ExecHooks (bool final)
+IvlMultiplexer :: ExecHooks (bool final)
{
- CcuList* hooks = final ? &FinalHooks : &Hooks;
- CcuListIter li = *hooks;
+ IvlList* hooks = final ? &FinalHooks : &Hooks;
+ IvlListIter li = *hooks;
while (++li) {
- DnnMpxHook* h = (DnnMpxHook*) *li;
+ IvlMpxHook* h = (IvlMpxHook*) *li;
(*h)();
}
}
MPX_RES
-DnnMultiplexer :: Loop ()
+IvlMultiplexer :: Loop ()
{
Looping = true;
while (Looping)
@@ -125,41 +122,39 @@ DnnMultiplexer :: Loop ()
}
void
-DnnMultiplexer :: Stop ()
+IvlMultiplexer :: Stop ()
{
Looping = false;
}
-
void
-DnnOpen (DnnBaseMultiplexer* m)
+IvlDnnOpen (IvlBaseMultiplexer* m)
{
- DnnMpx = m ? m : new DnnMultiplexer;
+ IvlMpx = m ? m : new IvlMultiplexer;
- CcuListIter li = *DnnBaseMultiplexer::GlobalHooks;
+ IvlListIter li = *IvlBaseMultiplexer::GlobalHooks;
while (++li)
- DnnMpx->AddHook ((DnnMpxHook*) *li, false);
+ IvlMpx->AddHook ((IvlMpxHook*) *li, false);
- li = *DnnBaseMultiplexer::GlobalFinalHooks;
+ li = *IvlBaseMultiplexer::GlobalFinalHooks;
while (++li)
- DnnMpx->AddFinalHook ((DnnMpxHook*) *li);
+ IvlMpx->AddFinalHook ((IvlMpxHook*) *li);
}
MPX_RES
-DnnLoop ()
+IvlLoop ()
{
- return DnnMpx->Loop ();
+ return IvlMpx->Loop ();
}
void
-DnnStop ()
+IvlStop ()
{
- DnnMpx->Stop ();
+ IvlMpx->Stop ();
}
void
-DnnClose ()
+IvlClose ()
{
}
-
diff --git a/dnn/Loop.h b/dnn/Loop.h
index 9009c39..55dcafc 100644
--- a/dnn/Loop.h
+++ b/dnn/Loop.h
@@ -12,71 +12,70 @@
* $CurLog$
*/
-#ifndef DnnMultiplexer_H_
-#define DnnMultiplexer_H_
+#ifndef IvlMultiplexer_H_
+#define IvlMultiplexer_H_
-#include "ccu/Initializer.h"
-#include "ccu/List.h"
+#include "ivl/Initializer.h"
+#include "ivl/List.h"
enum MPX_RES { isMpxEmpty, isMpxTerminated, isMpxError, isMpxAborted };
-typedef void (DnnMpxHook) ();
+typedef void (IvlMpxHook) ();
-class DnnBaseMultiplexer {
-friend void DnnOpen (DnnBaseMultiplexer*);
-friend MPX_RES DnnLoop ();
-friend void DnnClose ();
+class IvlBaseMultiplexer {
+friend void IvlDnnOpen (IvlBaseMultiplexer*);
+friend MPX_RES IvlLoop ();
+friend void IvlClose ();
public:
static bool ClassInitialized;
static void ClassInit ();
-static CcuInitializerFor <DnnBaseMultiplexer> Initializer;
+static IvlInitializerFor <IvlBaseMultiplexer> Initializer;
protected:
-static CcuList* GlobalHooks;
-static CcuList* GlobalFinalHooks;
+static IvlList* GlobalHooks;
+static IvlList* GlobalFinalHooks;
virtual MPX_RES Loop () = 0;
public:
- DnnBaseMultiplexer ();
-virtual ~DnnBaseMultiplexer ();
+ IvlBaseMultiplexer ();
+virtual ~IvlBaseMultiplexer ();
MPX_RES Run ();
virtual void Stop () = 0;
-static void AddGlobalHook (DnnMpxHook*, bool = false);
-static void RemoveGlobalHook (DnnMpxHook*, bool = false);
-virtual void AddHook (DnnMpxHook*, bool = false) = 0;
-virtual void RemoveHook (DnnMpxHook*, bool = false) = 0;
-virtual void AddFinalHook (DnnMpxHook*) = 0;
-virtual void RemoveFinalHook (DnnMpxHook*) = 0;
+static void AddGlobalHook (IvlMpxHook*, bool = false);
+static void RemoveGlobalHook (IvlMpxHook*, bool = false);
+virtual void AddHook (IvlMpxHook*, bool = false) = 0;
+virtual void RemoveHook (IvlMpxHook*, bool = false) = 0;
+virtual void AddFinalHook (IvlMpxHook*) = 0;
+virtual void RemoveFinalHook (IvlMpxHook*) = 0;
};
-class DnnMultiplexer : public DnnBaseMultiplexer {
+class IvlMultiplexer : public IvlBaseMultiplexer {
protected:
- CcuList Hooks;
- CcuList FinalHooks;
+ IvlList Hooks;
+ IvlList FinalHooks;
bool Looping;
void ExecHooks (bool = false);
MPX_RES Loop ();
public:
- DnnMultiplexer ();
- ~DnnMultiplexer ();
+ IvlMultiplexer ();
+ ~IvlMultiplexer ();
void Stop ();
- void AddHook (DnnMpxHook*, bool = false);
- void RemoveHook (DnnMpxHook*, bool = false);
- void AddFinalHook (DnnMpxHook*);
- void RemoveFinalHook (DnnMpxHook*);
+ void AddHook (IvlMpxHook*, bool = false);
+ void RemoveHook (IvlMpxHook*, bool = false);
+ void AddFinalHook (IvlMpxHook*);
+ void RemoveFinalHook (IvlMpxHook*);
};
+extern IvlBaseMultiplexer* IvlMpx;
+extern void IvlDnnOpen (IvlBaseMultiplexer* = 0);
+extern MPX_RES IvlLoop ();
+extern void IvlStop ();
+extern void IvlClose ();
-extern DnnBaseMultiplexer* DnnMpx;
-extern void DnnOpen (DnnBaseMultiplexer* = 0);
-extern MPX_RES DnnLoop ();
-extern void DnnStop ();
-extern void DnnClose ();
-
-#endif /* DnnMultiplexer_H_ */
+#endif /* IvlMultiplexer_H_ */
diff --git a/dnn/Reaction.cc b/dnn/Reaction.cc
index 77dbb83..c694ab5 100644
--- a/dnn/Reaction.cc
+++ b/dnn/Reaction.cc
@@ -15,8 +15,8 @@
#include "Reaction.h"
#include "Trigger.h"
-/*?class DnnBaseReaction
-The class \typ{DnnBaseReaction} is the base class for event handling.
+/*?class IvlBaseReaction
+The class \typ{IvlBaseReaction} is the base class for event handling.
A reaction implements a behaviour (through the virtual function \fun{Manage}),
and can be associated to one or more triggers, generally located in a sensor.
?*/
@@ -24,16 +24,16 @@ and can be associated to one or more triggers, generally located in a sensor.
/*?
Create a reaction.
?*/
-DnnBaseReaction :: DnnBaseReaction ()
+IvlBaseReaction :: IvlBaseReaction ()
: Triggers (),
Grabbed ()
{
}
/*?nodoc?*/
-DnnBaseReaction :: ~DnnBaseReaction ()
+IvlBaseReaction :: ~IvlBaseReaction ()
{
- CcuListIterOf <DnnTrigger> ti = Grabbed;
+ IvlListIterOf <IvlTrigger> ti = Grabbed;
while (++ti)
(*ti)->Release (*this);
@@ -47,7 +47,7 @@ Tell a reaction to forget a trigger. This special function is used only
when destroying a trigger.
!*/
void
-DnnBaseReaction :: Forget (DnnTrigger& t)
+IvlBaseReaction :: Forget (IvlTrigger& t)
{
Triggers.Remove (&t);
Grabbed.Remove (&t);
@@ -55,10 +55,10 @@ DnnBaseReaction :: Forget (DnnTrigger& t)
/*?nextdoc?*/
void
-DnnBaseReaction :: SubscribeTo (DnnTrigger& t, REL_PRIORITY p)
+IvlBaseReaction :: SubscribeTo (IvlTrigger& t, REL_PRIORITY p)
{
Triggers.Append (&t);
- t.Subscribe (*this, (DnnTrigger::REL_PRIORITY) p);
+ t.Subscribe (*this, (IvlTrigger::REL_PRIORITY) p);
}
/*?
@@ -66,7 +66,7 @@ Tell that a reaction should (resp. should no more) be activated when the trigger
causes the emission of an event.
?*/
void
-DnnBaseReaction :: UnsubscribeTo (DnnTrigger& t)
+IvlBaseReaction :: UnsubscribeTo (IvlTrigger& t)
{
Triggers.Remove (&t);
t.Unsubscribe (*this);
@@ -74,7 +74,7 @@ DnnBaseReaction :: UnsubscribeTo (DnnTrigger& t)
/*?nextdoc?*/
void
-DnnBaseReaction :: Grab (DnnTrigger& t)
+IvlBaseReaction :: Grab (IvlTrigger& t)
{
Grabbed.Append (&t);
t.Grab (*this);
@@ -85,7 +85,7 @@ Tell that a reaction should (resp. should no more) be the only one
activated when the trigger \var{t} causes the emission of an event.
?*/
void
-DnnBaseReaction :: Release (DnnTrigger& t)
+IvlBaseReaction :: Release (IvlTrigger& t)
{
Grabbed.Remove (&t);
t.Release (*this);
@@ -97,34 +97,34 @@ this reaction was attached. It should be redefined in derived classes to impleme
behaviours.
?*/
void
-DnnBaseReaction :: Manage (DnnEvent&)
+IvlBaseReaction :: Manage (IvlEvent&)
{
}
-/*?class DnnCallback
-The class \typ{DnnCallback} is a ready-to-use derived class of \typ{DnnBaseReaction}.
+/*?class IvlCallback
+The class \typ{IvlCallback} is a ready-to-use derived class of \typ{IvlBaseReaction}.
In this class, the function \fun{Manage} is redefined to call a function passed when creating
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}.
+\fun{f} has to take a \typ{IvlEvent\&} parameter and return \typ{void}.
?*/
-DnnCallback :: DnnCallback (DnnHandlingFunction f)
-: DnnBaseReaction (),
+IvlCallback :: IvlCallback (IvlHandlingFunction f)
+: IvlBaseReaction (),
Handler (f)
{
}
/*?nodoc?*/
-DnnCallback :: ~DnnCallback ()
+IvlCallback :: ~IvlCallback ()
{
}
/*?nodoc?*/
void
-DnnCallback :: Manage (DnnEvent& ev)
+IvlCallback :: Manage (IvlEvent& ev)
{
(*Handler) (ev);
}
diff --git a/dnn/Reaction.h b/dnn/Reaction.h
index 3d59fdb..c1fd2bb 100644
--- a/dnn/Reaction.h
+++ b/dnn/Reaction.h
@@ -12,100 +12,100 @@
* $CurLog$
*/
-#ifndef DnnReaction_H_
-#define DnnReaction_H_
+#ifndef IvlReaction_H_
+#define IvlReaction_H_
-#include "ccu/List.h"
+#include "ivl/List.h"
-class DnnTrigger;
-class DnnEvent;
+class IvlTrigger;
+class IvlEvent;
-class DnnBaseReaction {
-friend class DnnTrigger;
+class IvlBaseReaction {
+friend class IvlTrigger;
public:
enum REL_PRIORITY { isFirstPriority, isNormalPriority, isLastPriority };
protected:
- DnnBaseReaction ();
- CcuListOf <DnnTrigger> Triggers;
- CcuListOf <DnnTrigger> Grabbed;
+ IvlBaseReaction ();
+ IvlListOf <IvlTrigger> Triggers;
+ IvlListOf <IvlTrigger> Grabbed;
- void Forget (DnnTrigger&);
+ void Forget (IvlTrigger&);
public:
-virtual ~DnnBaseReaction ();
- void SubscribeTo (DnnTrigger&, REL_PRIORITY = isNormalPriority);
- void UnsubscribeTo (DnnTrigger&);
- void Grab (DnnTrigger&);
- void Release (DnnTrigger&);
-virtual void Manage (DnnEvent&);
+virtual ~IvlBaseReaction ();
+ void SubscribeTo (IvlTrigger&, REL_PRIORITY = isNormalPriority);
+ void UnsubscribeTo (IvlTrigger&);
+ void Grab (IvlTrigger&);
+ void Release (IvlTrigger&);
+virtual void Manage (IvlEvent&);
};
-typedef void (*DnnHandlingFunction) (DnnEvent&);
+typedef void (*IvlHandlingFunction) (IvlEvent&);
-class DnnCallback : public DnnBaseReaction {
+class IvlCallback : public IvlBaseReaction {
protected:
- DnnHandlingFunction Handler;
+ IvlHandlingFunction Handler;
public:
- DnnCallback (DnnHandlingFunction);
- ~DnnCallback ();
- void Manage (DnnEvent&);
+ IvlCallback (IvlHandlingFunction);
+ ~IvlCallback ();
+ void Manage (IvlEvent&);
};
-template <class T> class DnnReactionOf : public DnnBaseReaction {
+template <class T> class IvlReactionOf : public IvlBaseReaction {
protected:
T& Object;
- void (T::*Reaction) (DnnEvent&);
+ void (T::*Reaction) (IvlEvent&);
public:
- DnnReactionOf (T& o, void (T::*r) (DnnEvent&)) : DnnBaseReaction (), Object (o), Reaction (r) {}
- ~DnnReactionOf () {}
- void Manage (DnnEvent& ev) { (Object.*Reaction) (ev); }
+ IvlReactionOf (T& o, void (T::*r) (IvlEvent&)) : IvlBaseReaction (), Object (o), Reaction (r) {}
+ ~IvlReactionOf () {}
+ void Manage (IvlEvent& ev) { (Object.*Reaction) (ev); }
};
#define SpecializedReaction(R,S) \
-class R : public DnnBaseReaction { \
+class R : public IvlBaseReaction { \
protected: \
S& Body; \
- void (S::*React) (DnnEvent&); \
+ void (S::*React) (IvlEvent&); \
public: \
- R (S& s, void (S::*sc) (DnnEvent&)) : DnnBaseReaction (), Body (s), React (sc) {} \
+ R (S& s, void (S::*sc) (IvlEvent&)) : IvlBaseReaction (), Body (s), React (sc) {} \
~R () {} \
- void Manage (DnnEvent& ev) { (Body.*React) (ev); } \
+ void Manage (IvlEvent& ev) { (Body.*React) (ev); } \
};
/* Attempt at having reactions that locate the object which should be activated.
- DnnObjectReactionOf should be renamed DnnReactionOf,
- and DnnReactionOf should be renamed DnnBasicReactionOf */
+ IvlObjectReactionOf should be renamed IvlReactionOf,
+ and IvlReactionOf should be renamed IvlBasicReactionOf */
-class DnnObjectReaction : public DnnBaseReaction {
+class IvlObjectReaction : public IvlBaseReaction {
protected:
-virtual void* LocateObject (DnnEvent&) = 0;
+virtual void* LocateObject (IvlEvent&) = 0;
public:
- DnnObjectReaction () : DnnBaseReaction () {}
- ~DnnObjectReaction () {}
+ IvlObjectReaction () : IvlBaseReaction () {}
+ ~IvlObjectReaction () {}
};
-template <class T> class DnnObjectReactionOf : public DnnObjectReaction {
+template <class T> class IvlObjectReactionOf : public IvlObjectReaction {
protected:
- void (T::*Reaction) (DnnEvent&);
+ void (T::*Reaction) (IvlEvent&);
public:
- DnnObjectReactionOf (void (T::*r) (DnnEvent&)) : DnnObjectReaction (), Reaction (r) {}
- ~DnnObjectReactionOf () {}
- void Manage (DnnEvent& ev) { T* o = (T*) LocateObject (ev); (o->*Reaction) (ev); }
+ IvlObjectReactionOf (void (T::*r) (IvlEvent&)) : IvlObjectReaction (), Reaction (r) {}
+ ~IvlObjectReactionOf () {}
+ void Manage (IvlEvent& ev) { T* o = (T*) LocateObject (ev); (o->*Reaction) (ev); }
};
#if 0
-template <class T> class XtvReflexOf : public DnnObjectReactionOf <T> {
+template <class T> class XtvReflexOf : public IvlObjectReactionOf <T> {
protected:
- void* LocateObject (DnnEvent& ev) { return ((XtvEvent*)&ev)->GetTarget (); }
+ void* LocateObject (IvlEvent& ev) { return ((XtvEvent*)&ev)->GetTarget (); }
public:
- XtvReflexOf (void (T::*r) (DnnEvent&)) : DnnObjectReactionOf <T> (r) {}
+ XtvReflexOf (void (T::*r) (IvlEvent&)) : IvlObjectReactionOf <T> (r) {}
};
#endif
-#endif /* DnnReaction_H_ */
+#endif /* IvlReaction_H_ */
diff --git a/dnn/Source.cc b/dnn/Source.cc
index 516a710..cd39808 100755
--- a/dnn/Source.cc
+++ b/dnn/Source.cc
@@ -15,47 +15,47 @@
#include "Source.h"
#include "Trigger.h"
#include "Reaction.h"
-#include "ccu/Array.h"
-#include "ccu/HashTable.h"
+#include "ivl/Array.h"
+#include "ivl/HashTable.h"
-DnnEventSource :: DnnEventSource ()
+IvlEventSource :: IvlEventSource ()
{
}
-DnnEventSource :: ~DnnEventSource ()
+IvlEventSource :: ~IvlEventSource ()
{
}
void
-DnnEventSource :: Emit (DnnEvent* ev)
+IvlEventSource :: Emit (IvlEvent* ev)
{
/* should enqueue? */
DispatchEvent (ev);
}
-DnnEventSelector :: DnnEventSelector ()
+IvlEventSelector :: IvlEventSelector ()
{
}
-DnnEventSelector :: ~DnnEventSelector ()
+IvlEventSelector :: ~IvlEventSelector ()
{
}
-DnnEventIntSelector :: DnnEventIntSelector (DnnIntExtractor exid, int max)
-: DnnEventSelector (),
+IvlEventIntSelector :: IvlEventIntSelector (IvlIntExtractor exid, int max)
+: IvlEventSelector (),
IdExtractor (exid),
MaxSize (max),
Triggers (0)
{
}
-DnnEventIntSelector :: ~DnnEventIntSelector ()
+IvlEventIntSelector :: ~IvlEventIntSelector ()
{
if (Triggers) {
int id = 0;
#ifdef FIXME
while (id < MaxSize) {
- DnnTrigger* t = (*Triggers)[id];
+ IvlTrigger* t = (*Triggers)[id];
if (t)
delete t;
}
@@ -63,27 +63,26 @@ DnnEventIntSelector :: ~DnnEventIntSelector ()
}
}
-DnnTrigger*
-DnnEventIntSelector :: UseTrigger (int id)
+IvlTrigger*
+IvlEventIntSelector :: UseTrigger (int id)
{
if (!Triggers && MaxSize) {
- Triggers = new CcuArrayOf<DnnTrigger> (MaxSize, 0);
+ Triggers = new IvlArrayOf<IvlTrigger> (MaxSize, 0);
}
- /* no need to check bounds: CcuArray does it */
- DnnTrigger** t = *Triggers + id;
+ /* no need to check bounds: IvlArray does it */
+ IvlTrigger** t = *Triggers + id;
if (*t == 0) {
- *t = new DnnTrigger;
+ *t = new IvlTrigger;
}
return *t;
}
-
void
-DnnEventIntSelector :: UnuseTrigger (int id, DnnBaseReaction* r)
+IvlEventIntSelector :: UnuseTrigger (int id, IvlBaseReaction* r)
{
- DnnTrigger** t;
+ IvlTrigger** t;
if (!Triggers || !(t = *Triggers + id))
return;
@@ -94,26 +93,25 @@ DnnEventIntSelector :: UnuseTrigger (int id, DnnBaseReaction* r)
}
}
-DnnTrigger*
-DnnEventIntSelector :: FindTrigger (DnnEvent* ev)
+IvlTrigger*
+IvlEventIntSelector :: FindTrigger (IvlEvent* ev)
{
- DnnTrigger* t = 0;
+ IvlTrigger* t = 0;
int id = (IdExtractor) (ev);
if (Triggers)
t = (*Triggers) [id];
return t;
}
-
-DnnEventPtrSelector :: DnnEventPtrSelector (DnnPtrExtractor exid, int sz)
-: DnnEventSelector (),
+IvlEventPtrSelector :: IvlEventPtrSelector (IvlPtrExtractor exid, int sz)
+: IvlEventSelector (),
PtrExtractor (exid),
TblSize (sz),
Triggers (0)
{
}
-DnnEventPtrSelector :: ~DnnEventPtrSelector ()
+IvlEventPtrSelector :: ~IvlEventPtrSelector ()
{
if (Triggers) {
int id = 0;
@@ -122,32 +120,31 @@ DnnEventPtrSelector :: ~DnnEventPtrSelector ()
}
}
-DnnTrigger*
-DnnEventPtrSelector :: UseTrigger (void* id)
+IvlTrigger*
+IvlEventPtrSelector :: UseTrigger (void* id)
{
if (!Triggers && TblSize) {
- Triggers = new CcuHashTableOf<DnnTrigger> (TblSize);
+ Triggers = new IvlHashTableOf<IvlTrigger> (TblSize);
}
int found;
- CcuHashCellOf<DnnTrigger>* c = Triggers->Add (id, &found);
- DnnTrigger* t;
+ IvlHashCellOf<IvlTrigger>* c = Triggers->Add (id, &found);
+ IvlTrigger* t;
if (found)
t = c->GetInfo ();
else
- c->SetInfo (t = new DnnTrigger);
+ c->SetInfo (t = new IvlTrigger);
return t;
}
-
void
-DnnEventPtrSelector :: UnuseTrigger (void* id, DnnBaseReaction* r)
+IvlEventPtrSelector :: UnuseTrigger (void* id, IvlBaseReaction* r)
{
- CcuHashCellOf<DnnTrigger>* c;
+ IvlHashCellOf<IvlTrigger>* c;
if (!Triggers || !(c = Triggers->Get (id)))
return;
- DnnTrigger* t = c->GetInfo ();
+ IvlTrigger* t = c->GetInfo ();
r->UnsubscribeTo (*t);
if (t->IsUnused ()) {
delete t;
@@ -156,11 +153,11 @@ DnnEventPtrSelector :: UnuseTrigger (void* id, DnnBaseReaction* r)
}
}
-DnnTrigger*
-DnnEventPtrSelector :: FindTrigger (DnnEvent* ev)
+IvlTrigger*
+IvlEventPtrSelector :: FindTrigger (IvlEvent* ev)
{
- DnnTrigger* t = 0;
- CcuHashCellOf<DnnTrigger>* c;
+ IvlTrigger* t = 0;
+ IvlHashCellOf<IvlTrigger>* c;
void* id = (PtrExtractor) (ev);
diff --git a/dnn/Source.h b/dnn/Source.h
index ab5d55c..84b72ed 100755
--- a/dnn/Source.h
+++ b/dnn/Source.h
@@ -12,61 +12,59 @@
* $CurLog$
*/
-#ifndef DnnSource_H_
-#define DnnSource_H_
+#ifndef IvlSource_H_
+#define IvlSource_H_
#include "cplus_bugs.h"
-template <class ITEM> class CcuArrayOf;
-template <class ITEM> class CcuHashTableOf;
-class DnnTrigger;
-class DnnEvent;
-class DnnBaseReaction;
+template <class ITEM> class IvlArrayOf;
+template <class ITEM> class IvlHashTableOf;
+class IvlTrigger;
+class IvlEvent;
+class IvlBaseReaction;
-
-class DnnEventSource {
+class IvlEventSource {
protected:
- DnnEventSource ();
-virtual ~DnnEventSource ();
- void Emit (DnnEvent*);
-virtual void DispatchEvent (DnnEvent*) = 0;
+ IvlEventSource ();
+virtual ~IvlEventSource ();
+ void Emit (IvlEvent*);
+virtual void DispatchEvent (IvlEvent*) = 0;
};
-class DnnEventSelector {
+class IvlEventSelector {
public:
- DnnEventSelector ();
-virtual ~DnnEventSelector ();
-virtual DnnTrigger* FindTrigger (DnnEvent*) = 0;
+ IvlEventSelector ();
+virtual ~IvlEventSelector ();
+virtual IvlTrigger* FindTrigger (IvlEvent*) = 0;
};
-typedef int (*DnnIntExtractor) (DnnEvent*);
+typedef int (*IvlIntExtractor) (IvlEvent*);
-class DnnEventIntSelector : public DnnEventSelector {
+class IvlEventIntSelector : public IvlEventSelector {
protected:
- DnnIntExtractor IdExtractor;
+ IvlIntExtractor IdExtractor;
int MaxSize;
- CcuArrayOf<DnnTrigger> *Triggers;
+ IvlArrayOf<IvlTrigger> *Triggers;
public:
- DnnEventIntSelector (DnnIntExtractor, int);
- ~DnnEventIntSelector ();
- DnnTrigger* UseTrigger (int);
- void UnuseTrigger (int, DnnBaseReaction*);
- DnnTrigger* FindTrigger (DnnEvent*);
+ IvlEventIntSelector (IvlIntExtractor, int);
+ ~IvlEventIntSelector ();
+ IvlTrigger* UseTrigger (int);
+ void UnuseTrigger (int, IvlBaseReaction*);
+ IvlTrigger* FindTrigger (IvlEvent*);
};
-typedef void* (*DnnPtrExtractor) (DnnEvent*);
+typedef void* (*IvlPtrExtractor) (IvlEvent*);
-class DnnEventPtrSelector : public DnnEventSelector {
+class IvlEventPtrSelector : public IvlEventSelector {
protected:
- DnnPtrExtractor PtrExtractor;
+ IvlPtrExtractor PtrExtractor;
int TblSize;
- CcuHashTableOf<DnnTrigger> *Triggers;
+ IvlHashTableOf<IvlTrigger> *Triggers;
public:
- DnnEventPtrSelector (DnnPtrExtractor, int);
- ~DnnEventPtrSelector ();
- DnnTrigger* UseTrigger (void*);
- void UnuseTrigger (void*, DnnBaseReaction*);
- DnnTrigger* FindTrigger (DnnEvent*);
+ IvlEventPtrSelector (IvlPtrExtractor, int);
+ ~IvlEventPtrSelector ();
+ IvlTrigger* UseTrigger (void*);
+ void UnuseTrigger (void*, IvlBaseReaction*);
+ IvlTrigger* FindTrigger (IvlEvent*);
};
-
-#endif /* DnnSource_H_ */
+#endif /* IvlSource_H_ */
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;
diff --git a/dnn/Trigger.h b/dnn/Trigger.h
index 744eb3b..8844963 100644
--- a/dnn/Trigger.h
+++ b/dnn/Trigger.h
@@ -12,45 +12,45 @@
* $CurLog$
*/
-#ifndef DnnTrigger_H_
-#define DnnTrigger_H_
+#ifndef IvlTrigger_H_
+#define IvlTrigger_H_
#include "cplus_bugs.h"
-#include "ccu/List.h"
-#include "ccu/bool.h"
+#include "ivl/List.h"
+#include "ivl/bool.h"
-class DnnEvent;
-class DnnBaseCriterion;
+class IvlEvent;
+class IvlBaseCriterion;
-class DnnTrigger {
-friend class DnnBaseReaction;
+class IvlTrigger {
+friend class IvlBaseReaction;
public:
enum REL_PRIORITY { isFirstPriority, isNormalPriority, isLastPriority };
private:
- DnnTrigger (const DnnTrigger&);
- DnnTrigger& operator = (const DnnTrigger&);
+ IvlTrigger (const IvlTrigger&);
+ IvlTrigger& operator = (const IvlTrigger&);
protected:
- CcuListOf <DnnBaseReaction> FirstSubscribers;
- CcuListOf <DnnBaseReaction> Subscribers;
- CcuListOf <DnnBaseReaction> LastSubscribers;
- CcuListOf <DnnBaseReaction> Grabs;
- CcuListOf <DnnBaseCriterion> Criteria;
- void Subscribe (DnnBaseReaction&, REL_PRIORITY);
- void Unsubscribe (DnnBaseReaction&);
- void Grab (DnnBaseReaction&);
- void Release (DnnBaseReaction&);
+ IvlListOf <IvlBaseReaction> FirstSubscribers;
+ IvlListOf <IvlBaseReaction> Subscribers;
+ IvlListOf <IvlBaseReaction> LastSubscribers;
+ IvlListOf <IvlBaseReaction> Grabs;
+ IvlListOf <IvlBaseCriterion> Criteria;
+ void Subscribe (IvlBaseReaction&, REL_PRIORITY);
+ void Unsubscribe (IvlBaseReaction&);
+ void Grab (IvlBaseReaction&);
+ void Release (IvlBaseReaction&);
public:
- DnnTrigger ();
- ~DnnTrigger ();
+ IvlTrigger ();
+ ~IvlTrigger ();
inline bool IsUnused () const { return bool (Subscribers.IsEmpty () && FirstSubscribers.IsEmpty () && LastSubscribers.IsEmpty ()); }
- void Dispatch (DnnEvent&);
- bool Check (DnnEvent&);
-inline void AddCriterion (DnnBaseCriterion& c) { Criteria.Append (&c); }
-inline void RemoveCriterion (DnnBaseCriterion& c) { Criteria.Remove (&c); }
+ void Dispatch (IvlEvent&);
+ bool Check (IvlEvent&);
+inline void AddCriterion (IvlBaseCriterion& c) { Criteria.Append (&c); }
+inline void RemoveCriterion (IvlBaseCriterion& c) { Criteria.Remove (&c); }
};
-#endif /* DnnTrigger_H_ */
+#endif /* IvlTrigger_H_ */
diff --git a/dnn/test.cc b/dnn/test.cc
index 2697f1f..521fa0b 100644
--- a/dnn/test.cc
+++ b/dnn/test.cc
@@ -1,32 +1,31 @@
-#include "ccu.h"
+#include "ivl.h"
#include "dnn.h"
#include <stdio.h>
#include "Loop.h"
#include "Disposable.h"
-
#if 0
#if 0
class A {
public:
- void foo (DnnEvent&);
+ void foo (IvlEvent&);
};
main ()
{
A a;
- DnnReactionOf <A> r (a, &A::foo);
+ IvlReactionOf <A> r (a, &A::foo);
}
#else
-DnnEventFeature evf [] = {{"X", sizeof (int)}, {"Y", sizeof (int)}};
-DnnEventType click ("click", 2, evf);
+IvlEventFeature evf [] = {{"X", sizeof (int)}, {"Y", sizeof (int)}};
+IvlEventType click ("click", 2, evf);
-class DnnClickEvent : public DnnEvent {
+class IvlClickEvent : public IvlEvent {
public:
int X, Y;
- inline DnnClickEvent (int x, int y) : DnnEvent (&click, false), X (x), Y (y) {}
+ inline IvlClickEvent (int x, int y) : IvlEvent (&click, false), X (x), Y (y) {}
inline void SetX (int x) { X = x; }
inline void SetY (int y) { Y = y; }
inline int GetX () const { return X; }
@@ -35,7 +34,7 @@ public:
main ()
{
- DnnEvent ev (&click);
+ IvlEvent ev (&click);
int x = 3, y = 5;
ev.SetFeature (0, &x);
ev.SetFeature (1, &y);
@@ -43,7 +42,7 @@ main ()
ev.GetFeature (0, &x2);
ev.GetFeature (1, &y2);
printf ("(%d, %d)\n", x2, y2);
- DnnClickEvent ev2 (3, 5);
+ IvlClickEvent ev2 (3, 5);
int x22, y22;
ev.GetFeature (0, &x22);
ev.GetFeature (1, &y22);
@@ -54,7 +53,7 @@ main ()
#endif
#else
-class A : public DnnDisposable {
+class A : public IvlDisposable {
public:
A () { printf ("A::A\n"); }
~A () { printf ("A::~A\n"); }
@@ -69,19 +68,18 @@ foo ()
printf ("%d\n", i);
if (i >= 5) {
a->Trash ();
- DnnStop ();
+ IvlStop ();
}
i++;
}
-
main ()
{
- DnnOpen ();
+ IvlOpen ();
a = new A;
- DnnMpx->AddHook (foo);
- DnnLoop ();
- DnnClose ();
+ IvlMpx->AddHook (foo);
+ IvlLoop ();
+ IvlClose ();
}
#endif
diff --git a/dnn/version.h b/dnn/version.h
index c5556ea..f9e707c 100644
--- a/dnn/version.h
+++ b/dnn/version.h
@@ -12,7 +12,6 @@
* $CurLog$
*/
-
/***
* Copyright 1993-1994 Centre d'Etudes de la Navigation Aerienne (CENA)
*
@@ -62,10 +61,10 @@ phone +33 62 25 95 42
fax +33 62 25 95 99
**/
-#ifndef DnnVersion
+#ifndef IvlVersion
-#define DnnVersion 0
-#define DnnRelease 4
-#define DnnPatchLevel 0
+#define IvlVersion 0
+#define IvlRelease 4
+#define IvlPatchLevel 0
#endif