summaryrefslogtreecommitdiff
path: root/Ivy
diff options
context:
space:
mode:
Diffstat (limited to 'Ivy')
-rw-r--r--Ivy/IvyCallback.h28
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: