diff options
author | fcolin | 2007-02-01 13:01:11 +0000 |
---|---|---|
committer | fcolin | 2007-02-01 13:01:11 +0000 |
commit | 321483f0c1433e0b254584db97b3bc6f5ecaa24b (patch) | |
tree | b60f2dfb9bc596755ed0feabe7c8520854822c55 | |
parent | 741e6a814b53154a9b55a24de6fcb941af290439 (diff) | |
download | ivy-cplusplus-321483f0c1433e0b254584db97b3bc6f5ecaa24b.zip ivy-cplusplus-321483f0c1433e0b254584db97b3bc6f5ecaa24b.tar.gz ivy-cplusplus-321483f0c1433e0b254584db97b3bc6f5ecaa24b.tar.bz2 ivy-cplusplus-321483f0c1433e0b254584db97b3bc6f5ecaa24b.tar.xz |
Utilisateur : Fcolin Date : 16/06/00 Heure : 10:14 Créé (vss 1)
-rw-r--r-- | Ivy/IvyCallback.h | 83 |
1 files changed, 83 insertions, 0 deletions
diff --git a/Ivy/IvyCallback.h b/Ivy/IvyCallback.h new file mode 100644 index 0000000..4a41b9a --- /dev/null +++ b/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_ */
|