Application.h
Go to the documentation of this file.
1/* -*- C++ -*- */
2
3/****************************************************************************
4** Copyright (c) 2001-2014
5**
6** This file is part of the QuickFIX FIX Engine
7**
8** This file may be distributed under the terms of the quickfixengine.org
9** license as defined by quickfixengine.org and appearing in the file
10** LICENSE included in the packaging of this file.
11**
12** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
13** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
14**
15** See http://www.quickfixengine.org/LICENSE for licensing information.
16**
17** Contact ask@quickfixengine.org if any conditions of this licensing are
18** not clear to you.
19**
20****************************************************************************/
21
22#ifndef FIX_APPLICATION_H
23#define FIX_APPLICATION_H
24
25#include "Message.h"
26#include "SessionID.h"
27#include "Mutex.h"
28
29namespace FIX
30{
44{
45public:
46 virtual ~Application() {};
48 virtual void onCreate( const SessionID& ) = 0;
50 virtual void onLogon( const SessionID& ) = 0;
52 virtual void onLogout( const SessionID& ) = 0;
54 virtual void toAdmin( Message&, const SessionID& ) = 0;
56 virtual void toApp( Message&, const SessionID& )
57 throw( DoNotSend ) = 0;
59 virtual void fromAdmin( const Message&, const SessionID& )
62 virtual void fromApp( const Message&, const SessionID& )
64};
65
77{
78public:
80
81 void onCreate( const SessionID& sessionID )
82 { Locker l( m_mutex ); app().onCreate( sessionID ); }
83 void onLogon( const SessionID& sessionID )
84 { Locker l( m_mutex ); app().onLogon( sessionID ); }
85 void onLogout( const SessionID& sessionID )
86 { Locker l( m_mutex ); app().onLogout( sessionID ); }
87 void toAdmin( Message& message, const SessionID& sessionID )
88 { Locker l( m_mutex ); app().toAdmin( message, sessionID ); }
89 void toApp( Message& message, const SessionID& sessionID )
90 throw( DoNotSend )
91 { Locker l( m_mutex ); app().toApp( message, sessionID ); }
92 void fromAdmin( const Message& message, const SessionID& sessionID )
94 { Locker l( m_mutex ); app().fromAdmin( message, sessionID ); }
95 void fromApp( const Message& message, const SessionID& sessionID )
97 { Locker l( m_mutex ); app().fromApp( message, sessionID ); }
98
100
101 Application& app() { return m_app; }
103};
104
112{
113 void onCreate( const SessionID& ) {}
114 void onLogon( const SessionID& ) {}
115 void onLogout( const SessionID& ) {}
116 void toAdmin( Message&, const SessionID& ) {}
117 void toApp( Message&, const SessionID& )
118 throw( DoNotSend ) {}
123};
125}
126
127#endif //FIX_APPLICATION_H
This interface must be implemented to define what your FIX application does.
Definition Application.h:44
virtual void fromApp(const Message &, const SessionID &)=0
Notification of app message being received from target.
virtual void onCreate(const SessionID &)=0
Notification of a session begin created.
virtual void fromAdmin(const Message &, const SessionID &)=0
Notification of admin message being received from target.
virtual void toAdmin(Message &, const SessionID &)=0
Notification of admin message being sent to target.
virtual void onLogout(const SessionID &)=0
Notification of a session logging off or disconnecting.
virtual void toApp(Message &, const SessionID &)=0
Notification of app message being sent to target.
virtual void onLogon(const SessionID &)=0
Notification of a session successfully logging on.
virtual ~Application()
Definition Application.h:46
Locks/Unlocks a mutex using RAII.
Definition Mutex.h:96
Base class for all FIX messages.
Definition Message.h:118
Portable implementation of a mutex.
Definition Mutex.h:31
An empty implementation of an Application.
void onCreate(const SessionID &)
Notification of a session begin created.
void fromApp(const Message &, const SessionID &)
Notification of app message being received from target.
void onLogout(const SessionID &)
Notification of a session logging off or disconnecting.
void fromAdmin(const Message &, const SessionID &)
Notification of admin message being received from target.
void toApp(Message &, const SessionID &)
Notification of app message being sent to target.
void toAdmin(Message &, const SessionID &)
Notification of admin message being sent to target.
void onLogon(const SessionID &)
Notification of a session successfully logging on.
Unique session id consists of BeginString, SenderCompID and TargetCompID.
Definition SessionID.h:31
This is a special implementation of the Application interface that takes in another Application inter...
Definition Application.h:77
void onLogout(const SessionID &sessionID)
Notification of a session logging off or disconnecting.
Definition Application.h:85
void onLogon(const SessionID &sessionID)
Notification of a session successfully logging on.
Definition Application.h:83
void toApp(Message &message, const SessionID &sessionID)
Notification of app message being sent to target.
Definition Application.h:89
void fromAdmin(const Message &message, const SessionID &sessionID)
Notification of admin message being received from target.
Definition Application.h:92
void toAdmin(Message &message, const SessionID &sessionID)
Notification of admin message being sent to target.
Definition Application.h:87
SynchronizedApplication(Application &app)
Definition Application.h:79
void onCreate(const SessionID &sessionID)
Notification of a session begin created.
Definition Application.h:81
void fromApp(const Message &message, const SessionID &sessionID)
Notification of app message being received from target.
Definition Application.h:95
Indicates user does not want to send a message.
Definition Exceptions.h:218
Field not found inside a message.
Definition Exceptions.h:58
Field has a badly formatted value.
Definition Exceptions.h:147
Field has a value that is out of range.
Definition Exceptions.h:138
User wants to reject permission to logon.
Definition Exceptions.h:225
Message type not supported by application.
Definition Exceptions.h:177

Generated on Thu Feb 29 2024 22:38:19 for QuickFIX by doxygen 1.9.8 written by Dimitri van Heesch, © 1997-2001