summaryrefslogtreecommitdiff
path: root/Bus/Ivy/IvyCallback.h
diff options
context:
space:
mode:
authorfcolin2007-02-01 13:01:23 +0000
committerfcolin2007-02-01 13:01:23 +0000
commit609e3c74cce2b30d0b4f58b1355100e5a3a1ac87 (patch)
treeb0fa59f9ae749aae380f1bc212061bedb28c4cfb /Bus/Ivy/IvyCallback.h
parent1e6922ec5410dfdc39982ed9f7ff6d031006a04c (diff)
downloadivy-cplusplus-609e3c74cce2b30d0b4f58b1355100e5a3a1ac87.zip
ivy-cplusplus-609e3c74cce2b30d0b4f58b1355100e5a3a1ac87.tar.gz
ivy-cplusplus-609e3c74cce2b30d0b4f58b1355100e5a3a1ac87.tar.bz2
ivy-cplusplus-609e3c74cce2b30d0b4f58b1355100e5a3a1ac87.tar.xz
Utilisateur : Fcolin Date : 19/07/01 Heure : 15:22 Archivé dans $/Ivy Commentaire: Ajout callback static pour le CB application (vss 7)
Diffstat (limited to 'Bus/Ivy/IvyCallback.h')
-rw-r--r--Bus/Ivy/IvyCallback.h28
1 files changed, 28 insertions, 0 deletions
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: