From 609e3c74cce2b30d0b4f58b1355100e5a3a1ac87 Mon Sep 17 00:00:00 2001 From: fcolin Date: Thu, 1 Feb 2007 13:01:23 +0000 Subject: Utilisateur : Fcolin Date : 19/07/01 Heure : 15:22 Archivé dans $/Ivy Commentaire: Ajout callback static pour le CB application (vss 7) --- Bus/Ivy/IvyCallback.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/Bus/Ivy/IvyCallback.h b/Bus/Ivy/IvyCallback.h index 6a877e6..68b286a 100644 --- a/Bus/Ivy/IvyCallback.h +++ b/Bus/Ivy/IvyCallback.h @@ -65,6 +65,7 @@ public: }; /* Application Callback */ + class IvyApplicationCallback { public: virtual void OnApplicationConnected (IvyApplication *app) = 0; @@ -83,6 +84,33 @@ public: { } }; +// Static function CB +class IvyApplicationCallbackFunction: public IvyApplicationCallback { +public: + typedef void ( *IvyApplicationCallback_fun )( IvyApplication *app ); + IvyApplicationCallback_fun ApplicationConnectedCb; + IvyApplicationCallback_fun ApplicationDisconnectedCb; + +public: + IvyApplicationCallbackFunction ( IvyApplicationCallback_fun con_cb, IvyApplicationCallback_fun disc_cb) + : ApplicationConnectedCb( con_cb ), ApplicationDisconnectedCb( disc_cb ) + { + } + ~IvyApplicationCallbackFunction () + { + } + virtual void OnApplicationConnected (IvyApplication *app) + { + (*ApplicationConnectedCb) (app); + }; + virtual void OnApplicationDisconnected (IvyApplication *app) + { + (*ApplicationDisconnectedCb) (app); + }; + +/* raccourci d'ecriture */ +#define BUS_APPLICATION_CALLBACK( conn, disconn ) new IvyApplicationCallbackFunction( conn, disconn ) +}; /* Callback for the die Message */ class IvyDieCallback { public: -- cgit v1.1