ISessionListener.h

Go to the documentation of this file.
00001 /*
00002 * (c) Onix Solutions.
00003 */
00004 
00005 #ifndef ICppSessionListener_h
00006 #define ICppSessionListener_h
00007 
00008 #include "FIXEngineDefines.h"
00009 
00010 namespace FIXForge{
00011 namespace FIX{
00012     class Message;
00013     class Session;
00014 
00015 /// Session's Listener interface.
00016 class FF_API ISessionListener{
00017     public:
00018     /// Is called when the applicatition-level message is received from the counterparty.
00019     virtual void onInboundApplicationMsg(const Message& msg, Session* sn){;}
00020 
00021     /// Is called when the session-level message is received from the counterparty.
00022     virtual void onInboundSessionMsg(const Message& msg, Session* sn){}
00023 
00024     /// Is called when the applicatition-level message is sent to the counterparty.
00025     virtual void onOutboundApplicationMsg(const Message& msg, Session* sn){};
00026 
00027     /// Is called when the session-level message is is sent to the counterparty.
00028     virtual void onOutboundSessionMsg(const Message& msg, Session* sn){};
00029 
00030     /// Is called when the session changes its state.
00031     virtual void onStateChange(Session::State newState, Session::State prevState, Session* sn){;}
00032 
00033     /// Is called when the sent application-level message is about to be re-sent to the counterparty in reply to the ResendRequest<2> message.
00034     ///
00035     /// @return 'true' if the message should be re-sent, otherwise - 'false'.
00036     virtual bool onResendRequest(const Message& msg, Session* sn){return true;}
00037 
00038     /// Error reason.
00039     enum ErrorReason{FIRST_MESSAGE_NOT_A_LOGON, MSG_SEQ_NUM_TOO_LOW, CANNOT_RESTORE_CONNECTION};
00040 
00041     /// Is called when an error condition is detected.
00042     virtual void onError(ErrorReason reason, const std::string& description, Session* sn){};
00043 
00044     /// Warning reason.
00045     enum WarningReason{GARBLED_MESSAGE_RECEIVED, LINK_ERROR};
00046 
00047     /// Is called when a warning condition is detected.
00048     virtual void onWarning(WarningReason reason, const std::string& description, Session* sn){}
00049 };
00050 }};
00051 
00052 #endif

Generated on Wed Oct 8 18:58:59 2008 for FIXForge C++ FIX Engine by  doxygen 1.5.2