summaryrefslogtreecommitdiff
path: root/Bus/Ivy/IvyCallback.h
diff options
context:
space:
mode:
Diffstat (limited to 'Bus/Ivy/IvyCallback.h')
-rw-r--r--Bus/Ivy/IvyCallback.h83
1 files changed, 83 insertions, 0 deletions
diff --git a/Bus/Ivy/IvyCallback.h b/Bus/Ivy/IvyCallback.h
new file mode 100644
index 0000000..4a41b9a
--- /dev/null
+++ b/Bus/Ivy/IvyCallback.h
@@ -0,0 +1,83 @@
+// IvyCallback.h : Interface for the IvyMessageCallback Class
+// : Interface for the IvyDirectMessageCallback Class
+// : Interface for the IvyApplicationCallback Class
+//
+/////////////////////////////////////////////////////////////////////////////
+// Description :
+//
+/////////////////////////////////////////////////////////////////////////////
+//
+// $Header: /libIvy/IvyCallback.h 5 16/03/99 10:59 Fcolin $
+// $Modtime: 16/03/99 10:26 $
+
+/* --------------------------------------------------------
+ * $History: IvyCallback.h $
+ *
+ * ***************** Version 5 *****************
+ * User: Fcolin Date: 16/03/99 Time: 10:59
+ * Updated in $/libIvy
+ *
+ * ***************** Version 4 *****************
+ * User: Fcolin Date: 12/03/99 Time: 18:53
+ * Updated in $/libIvy
+ *
+ * ***************** Version 3 *****************
+ * User: Fcolin Date: 12/03/99 Time: 18:16
+ * Updated in $/libIvy
+ * Modif Api Callback
+ * --------------------------------------------------------
+ */
+
+
+#ifndef IvyCallback_H_
+#define IvyCallback_H_
+
+class IvyApplication;
+
+/* Callback for the normal bus Message */
+/* Callback for the normal bus Message */
+class IvyMessageCallback {
+public:
+ virtual void OnMessage (IvyApplication *app, int argc, const char **argv )=0;
+};
+/* template Class Callback for the normal bus Message */
+template <class T> class IvyMessageCallbackOf : public IvyMessageCallback {
+
+protected:
+ T* Object;
+ typedef void ( T::*IvyMessageCallback_fun )( IvyApplication *app, int argc, const char **argv );
+ IvyMessageCallback_fun MessageCb;
+
+public:
+ IvyMessageCallbackOf ( T* o, IvyMessageCallback_fun m_cb ) : Object (o), MessageCb( m_cb )
+ {
+ }
+ ~IvyMessageCallbackOf ()
+ {
+ }
+ void OnMessage (IvyApplication *app, int argc, const char **argv)
+ {
+ (Object->*MessageCb) (app, argc, argv);
+ }
+/* raccourci d'ecriture */
+#define BUS_CALLBACK_OF( cl, m ) new IvyMessageCallbackOf<cl>( this, m )
+};
+/* Callback for the direct Message */
+class IvyDirectMessageCallback {
+public:
+ virtual void OnDirectMessage (IvyApplication *app, int id, const char *arg ) = 0;
+};
+
+/* Application Callback */
+class IvyApplicationCallback {
+public:
+ virtual void OnApplicationConnected (IvyApplication *app) = 0;
+ virtual void OnApplicationDisconnected (IvyApplication *app) = 0;
+};
+/* Callback for the die Message */
+class IvyDieCallback {
+public:
+ virtual BOOL OnDie (IvyApplication *app, int id, const char *arg ) = 0;
+};
+
+#endif /* IvyCallback_H_ */