summaryrefslogtreecommitdiff
path: root/Bus
diff options
context:
space:
mode:
Diffstat (limited to 'Bus')
-rw-r--r--Bus/Ivy/IvyCallback.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/Bus/Ivy/IvyCallback.h b/Bus/Ivy/IvyCallback.h
index 68b286a..25368f0 100644
--- a/Bus/Ivy/IvyCallback.h
+++ b/Bus/Ivy/IvyCallback.h
@@ -19,22 +19,24 @@ public:
};
class IvyMessageCallbackFunction: public IvyMessageCallback {
public:
- typedef void ( *IvyMessageCallback_fun )( IvyApplication *app, int argc, const char **argv );
+ typedef void ( *IvyMessageCallback_fun )( IvyApplication *app, void *user_data, int argc, const char **argv );
IvyMessageCallback_fun MessageCb;
+ void *data;
public:
- IvyMessageCallbackFunction ( IvyMessageCallback_fun m_cb ) : MessageCb( m_cb )
+ IvyMessageCallbackFunction ( IvyMessageCallback_fun m_cb, void *udata = NULL ) : MessageCb( m_cb )
{
+ data = udata;
}
~IvyMessageCallbackFunction ()
{
}
void OnMessage (IvyApplication *app, int argc, const char **argv)
{
- (*MessageCb) (app, argc, argv);
+ (*MessageCb) (app, data, argc, argv);
}
/* raccourci d'ecriture */
-#define BUS_CALLBACK( m ) new IvyMessageCallbackFunction( m )
+#define BUS_CALLBACK( m , d ) new IvyMessageCallbackFunction( m, d )
};
/* template Class Callback for the normal bus Message */
template <class T> class IvyMessageCallbackOf : public IvyMessageCallback {