#pragma once // IvyApplication.h : header file // #include "BufferedSocket.h" #include "Ivy.h" #include "IvyBinding.h" ///////////////////////////////////////////////////////////////////////////// // IvyApplication command target class IvyApplication : public CBufferedSocket { // Attributes public: typedef enum { Bye, /* quit l'application ( non utilise ) */ AddRegexp, /* expression reguliere d'un client */ Msg, /* message reel */ Error, /* error message */ DelRegexp, /* Remove expression reguliere */ EndRegexp, /* end of the regexp list */ StartRegexp, /* debut des expressions */ DirectMsg, /* message direct a destination de l'appli */ Die, /* demande de terminaison de l'appli */ Ping, /* message de controle ivy */ Pong /* ivy doit renvoyer ce message à la reception d'un ping */ }MsgType; // Operations public: IvyApplication(Ivy *bus); virtual ~IvyApplication(); // Overrides public: BOOL SameApplication( IvyApplication *app ); UINT remoteService; const char *GetName(void); inline Ivy *GetBus(void){ return bus;}; int SendMsg( const char *message ); void SendMsg( MsgType msg, int id, const char * arg = NULL); UINT Create(); void OnReceive( char *line ); void Create( const char * host, UINT &port, const char* name ); virtual void OnAccept(int nErrorCode); virtual void OnClose(int nErrorCode); // Implementation protected: ivy::string appname; bool AppConnectedCallbackCalled; Ivy *bus; /* liste des souscriptions remote */ /* en clair */ ivy::map regexp_str_in; /* compile */ typedef ivy::map Bindings; Bindings regexp_in; friend class Ivy; };