summaryrefslogtreecommitdiff
path: root/Ivy
diff options
context:
space:
mode:
Diffstat (limited to 'Ivy')
-rw-r--r--Ivy/IvyCallback.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/Ivy/IvyCallback.h b/Ivy/IvyCallback.h
index e311f58..f1075dc 100644
--- a/Ivy/IvyCallback.h
+++ b/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 {