diff options
author | fcolin | 2007-02-01 13:01:23 +0000 |
---|---|---|
committer | fcolin | 2007-02-01 13:01:23 +0000 |
commit | 1172ab63f087da01ee116d155b1b9d3e87bf2ef3 (patch) | |
tree | 4e4fc5ba6353e5d6a3d08ce71cf128d6c6e96c55 /Ivy/IvyCallback.h | |
parent | 3f798c133bcf62c1fed88d1beb66c7284285c99c (diff) | |
download | ivy-cplusplus-1172ab63f087da01ee116d155b1b9d3e87bf2ef3.zip ivy-cplusplus-1172ab63f087da01ee116d155b1b9d3e87bf2ef3.tar.gz ivy-cplusplus-1172ab63f087da01ee116d155b1b9d3e87bf2ef3.tar.bz2 ivy-cplusplus-1172ab63f087da01ee116d155b1b9d3e87bf2ef3.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 'Ivy/IvyCallback.h')
-rw-r--r-- | Ivy/IvyCallback.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/Ivy/IvyCallback.h b/Ivy/IvyCallback.h index 6a877e6..68b286a 100644 --- a/Ivy/IvyCallback.h +++ b/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:
|