From 83f2c117da25758e2dc6ff0da0b53280595840cf Mon Sep 17 00:00:00 2001 From: fcolin Date: Thu, 1 Feb 2007 13:01:11 +0000 Subject: Utilisateur : Fcolin Date : 16/06/00 Heure : 10:14 Créé (vss 1) --- Bus/Ivy/IvyCallback.h | 83 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 Bus/Ivy/IvyCallback.h (limited to 'Bus/Ivy') diff --git a/Bus/Ivy/IvyCallback.h b/Bus/Ivy/IvyCallback.h new file mode 100644 index 0000000..4a41b9a --- /dev/null +++ b/Bus/Ivy/IvyCallback.h @@ -0,0 +1,83 @@ +// IvyCallback.h : Interface for the IvyMessageCallback Class +// : Interface for the IvyDirectMessageCallback Class +// : Interface for the IvyApplicationCallback Class +// +///////////////////////////////////////////////////////////////////////////// +// Description : +// +///////////////////////////////////////////////////////////////////////////// +// +// $Header: /libIvy/IvyCallback.h 5 16/03/99 10:59 Fcolin $ +// $Modtime: 16/03/99 10:26 $ + +/* -------------------------------------------------------- + * $History: IvyCallback.h $ + * + * ***************** Version 5 ***************** + * User: Fcolin Date: 16/03/99 Time: 10:59 + * Updated in $/libIvy + * + * ***************** Version 4 ***************** + * User: Fcolin Date: 12/03/99 Time: 18:53 + * Updated in $/libIvy + * + * ***************** Version 3 ***************** + * User: Fcolin Date: 12/03/99 Time: 18:16 + * Updated in $/libIvy + * Modif Api Callback + * -------------------------------------------------------- + */ + + +#ifndef IvyCallback_H_ +#define IvyCallback_H_ + +class IvyApplication; + +/* Callback for the normal bus Message */ +/* Callback for the normal bus Message */ +class IvyMessageCallback { +public: + virtual void OnMessage (IvyApplication *app, int argc, const char **argv )=0; +}; +/* template Class Callback for the normal bus Message */ +template class IvyMessageCallbackOf : public IvyMessageCallback { + +protected: + T* Object; + typedef void ( T::*IvyMessageCallback_fun )( IvyApplication *app, int argc, const char **argv ); + IvyMessageCallback_fun MessageCb; + +public: + IvyMessageCallbackOf ( T* o, IvyMessageCallback_fun m_cb ) : Object (o), MessageCb( m_cb ) + { + } + ~IvyMessageCallbackOf () + { + } + void OnMessage (IvyApplication *app, int argc, const char **argv) + { + (Object->*MessageCb) (app, argc, argv); + } +/* raccourci d'ecriture */ +#define BUS_CALLBACK_OF( cl, m ) new IvyMessageCallbackOf( this, m ) +}; +/* Callback for the direct Message */ +class IvyDirectMessageCallback { +public: + virtual void OnDirectMessage (IvyApplication *app, int id, const char *arg ) = 0; +}; + +/* Application Callback */ +class IvyApplicationCallback { +public: + virtual void OnApplicationConnected (IvyApplication *app) = 0; + virtual void OnApplicationDisconnected (IvyApplication *app) = 0; +}; +/* Callback for the die Message */ +class IvyDieCallback { +public: + virtual BOOL OnDie (IvyApplication *app, int id, const char *arg ) = 0; +}; + +#endif /* IvyCallback_H_ */ -- cgit v1.1