summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorchatty2000-11-28 15:29:50 +0000
committerchatty2000-11-28 15:29:50 +0000
commit05ece2870309dbae1d2a182bcd13a732b606f331 (patch)
tree80eb5c166987abfbf80facc86d14cf278f9869f6
parent0830afbb9473c552ab021873d96324a5df4553bc (diff)
downloadivy-league-05ece2870309dbae1d2a182bcd13a732b606f331.zip
ivy-league-05ece2870309dbae1d2a182bcd13a732b606f331.tar.gz
ivy-league-05ece2870309dbae1d2a182bcd13a732b606f331.tar.bz2
ivy-league-05ece2870309dbae1d2a182bcd13a732b606f331.tar.xz
Archiving files that were born dead
-rwxr-xr-xdnn/behaviour.cc42
-rwxr-xr-xdnn/behaviour.h86
2 files changed, 128 insertions, 0 deletions
diff --git a/dnn/behaviour.cc b/dnn/behaviour.cc
new file mode 100755
index 0000000..f85bd20
--- /dev/null
+++ b/dnn/behaviour.cc
@@ -0,0 +1,42 @@
+/*
+ * DNN - Data News Network
+ *
+ * by Stephane Chatty
+ *
+ * Copyright 1993-1996
+ * Centre d'Etudes de la Navigation Aerienne (CENA)
+ *
+ * Behaviours.
+ *
+ * $Id$
+ * $CurLog$
+ */
+
+#include "Behaviour.h"
+
+#if 0
+template <class T>
+CcuKey*
+DnnBehaviourOf<T> :: GetEventType (CcuToken* t)
+{
+ DnnEvent* e = (DnnEvent*) t;
+ return (CcuKey*) t->GetType ();
+}
+#endif
+
+#if 0
+
+DnnSuperState :: DnnSuperState (const char* name, CcuAutomaton& a)
+: CcuBaseState (name, a),
+ Criteria ()
+{
+}
+
+void
+DnnSuperState :: CreateLink (DnnSuperState* to, DnnCriterion* c)
+{
+ CcuHashCellOf <CcuBaseLink>* c = Links.Add ();
+ c->SetInfo (new DnnActionOf
+}
+#endif
+
diff --git a/dnn/behaviour.h b/dnn/behaviour.h
new file mode 100755
index 0000000..01f382b
--- /dev/null
+++ b/dnn/behaviour.h
@@ -0,0 +1,86 @@
+/*
+ * DNN - Data News Network
+ *
+ * by Stephane Chatty
+ *
+ * Copyright 1993-1995
+ * Centre d'Etudes de la Navigation Aerienne (CENA)
+ *
+ * Behaviours.
+ *
+ * $Id$
+ * $CurLog$
+ */
+
+#ifndef DnnBehaviour_H_
+#define DnnBehaviour_H_
+
+#include "cplus_bugs.h"
+#include "ccu/Automaton.h"
+class DnnEvent;
+
+// en cours de developpement.
+
+template <class T> class DnnStateOf;
+
+template <class T> class DnnActionOf : public CcuBaseLink {
+protected:
+ T& Object;
+ void (T::*Action) (DnnStateOf<T>*, DnnStateOf<T>*, DnnEvent*);
+
+ void Fire (CcuBaseState* f, CcuBaseState* t, CcuToken* k) { if (Action) (Object.*Action) ((DnnStateOf<T>*) f, (DnnStateOf<T>*) t, (DnnEvent*) k);}
+
+public:
+ DnnActionOf (DnnStateOf<T>* s, DnnEventType* k, T& o, void (T::*a) (DnnStateOf<T>*, DnnStateOf<T>*, DnnEvent*)) : CcuBaseLink (s), Object (o), Action (a) {}
+ ~DnnActionOf () {}
+
+};
+
+#if 0
+/* future version of States: they create reactions associated to their links when entered. */
+
+class DnnSuperState : public CcuBaseState {
+protected:
+ CcuListOf<DnnCriterion> Criteria;
+ void In ();
+ void Out ();
+public:
+ DnnSuperState (const char* n, CcuAutomaton& b) : CcuBaseState (n, b) {}
+ ~DnnSuperState ();
+ void CreateLink (DnnSuperState*, DnnCriterion*);
+};
+
+template <class T> class DnnStateOf : public CcuBaseState {
+protected:
+ void In () {}
+ void Out () {}
+public:
+ DnnStateOf (const char* n, DnnBehaviourOf<T>& b) : CcuBaseState (n, b) {}
+ ~DnnStateOf () {}
+ void CreateLink (DnnStateOf<T>* to, DnnEventType* k, T& o, void (T::*a) (DnnStateOf<T>*, DnnStateOf<T>*, DnnEvent*)) { CcuHashCellOf <CcuBaseLink>* c = Links.Add (k); c->SetInfo (new DnnActionOf<T> (to, k, o, a)); }
+};
+
+template <class T> class DnnBehaviourOf : public CcuBaseAutomaton {
+protected:
+static CcuKey* GetEventType (CcuToken*);
+public:
+ DnnBehaviourOf () : CcuBaseAutomaton (&GetEventType) {}
+ ~DnnBehaviourOf () {}
+ DnnStateOf<T>* CreateState (const char* n) { DnnStateOf<T>* s = new DnnStateOf<T> (n, *this); AllStates.Append (s); return s; }
+};
+
+template <class T>
+CcuKey*
+DnnBehaviourOf<T> :: GetEventType (CcuToken* t)
+{
+ DnnEvent* e = (DnnEvent*) t;
+ return (CcuKey*) e->GetType ();
+}
+
+
+// tentative du 20/11/95
+template <class T> class DnnInteractionOf : public CcuAutomIter {
+ DnnInteractionOf (DnnBehaviourOf<T>& b) : CcuAutomIter (b) {}
+};
+#endif
+#endif /* DnnBehaviour_H_ */