diff options
author | fcolin | 2007-02-01 12:56:59 +0000 |
---|---|---|
committer | fcolin | 2007-02-01 12:56:59 +0000 |
commit | 1f4555f8bf84050f51cdbee46405a7805f663ff3 (patch) | |
tree | 7176f7989aa93208e9c140822fc387c52687cce2 | |
parent | 3581ff8256c9c157bfa29b65da5486885a7b910f (diff) | |
download | ivy-cplusplus-1f4555f8bf84050f51cdbee46405a7805f663ff3.zip ivy-cplusplus-1f4555f8bf84050f51cdbee46405a7805f663ff3.tar.gz ivy-cplusplus-1f4555f8bf84050f51cdbee46405a7805f663ff3.tar.bz2 ivy-cplusplus-1f4555f8bf84050f51cdbee46405a7805f663ff3.tar.xz |
Utilisateur : Fcolin Date : 16/06/00 Heure : 10:14 Créé (vss 1)
-rw-r--r-- | Bus/Ivy/Ivy.h | 97 |
1 files changed, 97 insertions, 0 deletions
diff --git a/Bus/Ivy/Ivy.h b/Bus/Ivy/Ivy.h new file mode 100644 index 0000000..4fa1859 --- /dev/null +++ b/Bus/Ivy/Ivy.h @@ -0,0 +1,97 @@ +// Ivy.h: interface for the Ivy class.
+//
+//////////////////////////////////////////////////////////////////////
+
+#if !defined(AFX_BUS_H__F7F08FE9_E653_11D0_AE3E_080009F92591__INCLUDED_)
+#define AFX_BUS_H__F7F08FE9_E653_11D0_AE3E_080009F92591__INCLUDED_
+
+#if _MSC_VER >= 1000
+#pragma once
+#endif // _MSC_VER >= 1000
+#ifdef WIN32
+#ifdef IVY_EXPORTS
+class _declspec(dllexport) IvyWatcher;
+class _declspec(dllexport) IvyApplication;
+class _declspec(dllexport) Ivy;
+#else
+#pragma comment(lib,"Ivy.LIB" )
+class _declspec(dllimport) IvyWatcher;
+class _declspec(dllimport) IvyApplication;
+class _declspec(dllimport) Ivy;
+#endif
+#endif
+
+#include "stdafx.h"
+
+#include "IvyCallback.h"
+
+class IvyWatcher;
+
+class IvyApplication;
+
+class Ivy
+{
+private:
+
+ UINT applicationPort;
+ void SendSubscriptions(IvyApplication *app);
+
+public:
+ void AddApplication( IvyApplication *app );
+ void RemoveApplication( IvyApplication *app);
+
+ BOOL CheckConnected( IvyApplication *app );
+ BOOL CheckRegexp( const char *exp );
+ void CallApplicationConnectedCallback( IvyApplication *app );
+ void CallApplicationDisconnectedCallback( IvyApplication *app );
+ BOOL CallDieCallback( IvyApplication *app, int id, const char *arg );
+ void CallDirectMessageCallback( IvyApplication *app, int id, const char *arg );
+ void CallMessageCallback( IvyApplication *app, int id, int argc, const char **argv );
+
+
+public:
+
+ void Classes( int argc, const char **argv );
+
+ void SendDirectMsg( IvyApplication *app, int id, const char *message);
+ void BindDirectMsg( IvyDirectMessageCallback *callback );
+ int SendMsg( const char *message );
+
+ const char *GetDomain(const char *domainlist);
+ UINT GetApplicationPort();
+ int BindMsg( const char *regexp, IvyMessageCallback *cb );
+ void UnbindMsg( int id );
+ Ivy( const char *name, const char* ready, IvyApplicationCallback *callback, bool Synchronous = true );
+ void start(const char *domain);
+ void stop();
+ virtual ~Ivy();
+
+ /* message a emettre sur connection nouvelle application */
+ string ready_message;
+
+protected:
+ bool synchronous; // use Window Shink to made CB mono thread like
+ IvyApplication * server;
+ IvyWatcher * watcher;
+ IvyDieCallback *die_callback;
+ IvyDirectMessageCallback *direct_callback;
+ IvyApplicationCallback *application_callback;
+ /* list des adresses de broadcast */
+ string domain;
+ /* nom de l'appliction */
+ string appname;
+ /* liste des clients connectes */
+ CRITICAL_SECTION m_application_cs;
+ std::vector<IvyApplication*> applications;
+
+ /* liste des souscriptions locale a emettre aux autres applications */
+ std::vector<string> regexp_out;
+ /* liste des callbacks a appeler */
+ std::vector< IvyMessageCallback* > callbacks;
+ /* classes de messages emis par l'application utilise pour le filtrage */
+ int messages_classes_count;
+ const char **messages_classes;
+
+};
+
+#endif // !defined(AFX_BUS_H__F7F08FE9_E653_11D0_AE3E_080009F92591__INCLUDED_)
|