From adc074b0e7619caac2f0edbfc9ee058e16f0b6da Mon Sep 17 00:00:00 2001 From: fcolin Date: Thu, 1 Feb 2007 13:03:30 +0000 Subject: Utilisateur : Fcolin Date : 21/07/00 Heure : 10:48 Archivé dans $/Ivy Commentaire: separation file cb de la file de message windows (vss 3) --- Bus/Ivy/IvySynchroWnd.h | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) (limited to 'Bus') diff --git a/Bus/Ivy/IvySynchroWnd.h b/Bus/Ivy/IvySynchroWnd.h index 5abd3ff..fba864e 100644 --- a/Bus/Ivy/IvySynchroWnd.h +++ b/Bus/Ivy/IvySynchroWnd.h @@ -12,6 +12,8 @@ #include "IvyApplication.h" +class IvySynchronousCallback; + class IvySynchroWnd //: public CWnd { // Construction @@ -21,12 +23,10 @@ public: // Attributes public: + // Operations public: - void PostMessageCB (IvyMessageCallback *target, IvyApplication *app, int argc, const char **argv ); - void PostApplicationConnectedCB( IvyApplicationCallback *target, IvyApplication *app); - void PostApplicationDisconnectedCB( IvyApplicationCallback *target, IvyApplication *app); - + void PostIvyCB( IvySynchronousCallback *cb ); // Overrides // ClassWizard generated virtual function overrides //{{AFX_VIRTUAL(IvySynchroWnd) @@ -48,12 +48,13 @@ protected: WPARAM wParam, // first message parameter LPARAM lParam // second message parameter ); + // Buffer Emission + CRITICAL_SECTION m_CritSection; + std::list callbacklist; protected: - LRESULT OnMessageCB(WPARAM wParam, LPARAM lParam); - LRESULT OnApplicationConnectedCB(WPARAM wParam, LPARAM lParam); - LRESULT OnApplicationDisconnectedCB(WPARAM wParam, LPARAM lParam); + LRESULT OnIvyCB(WPARAM wParam, LPARAM lParam); friend class IvySynchronousMessageCallback; friend class IvySynchronousApplicationCallback; @@ -64,12 +65,16 @@ protected: IvyApplication *app; static IvySynchroWnd *m_synchro; friend class Ivy; +public: + virtual void CallCallback() = 0; + }; class IvySynchronousMessageCallback: public IvySynchronousCallback, public IvyMessageCallback { public: IvySynchronousMessageCallback( IvyMessageCallback *cb ); virtual ~IvySynchronousMessageCallback(); + virtual void CallCallback(); virtual void OnMessage (IvyApplication *app, int argc, const char **argv ); protected: @@ -83,11 +88,14 @@ class IvySynchronousApplicationCallback: public IvySynchronousCallback, public { public: IvySynchronousApplicationCallback( IvyApplicationCallback *cb ); + virtual void CallCallback(); virtual void OnApplicationConnected (IvyApplication *app); virtual void OnApplicationDisconnected (IvyApplication *app); protected: IvyApplicationCallback *target; - + typedef enum { CONNECTED_CB, DISCONNECTED_CB } CallbackType; + CallbackType type; + friend class IvySynchroWnd; }; ///////////////////////////////////////////////////////////////////////////// -- cgit v1.1