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