Public Member Functions | Public Attributes | List of all members
FIX::SynchronizedApplication Class Reference

This is a special implementation of the Application interface that takes in another Application interface and synchronizes all of its callbacks. More...

#include <Application.h>

Inheritance diagram for FIX::SynchronizedApplication:
Inheritance graph
[legend]
Collaboration diagram for FIX::SynchronizedApplication:
Collaboration graph
[legend]

Public Member Functions

 SynchronizedApplication (Application &app)
 
void onCreate (const SessionID &sessionID)
 Notification of a session begin created. More...
 
void onLogon (const SessionID &sessionID)
 Notification of a session successfully logging on. More...
 
void onLogout (const SessionID &sessionID)
 Notification of a session logging off or disconnecting. More...
 
void toAdmin (Message &message, const SessionID &sessionID)
 Notification of admin message being sent to target. More...
 
void toApp (Message &message, const SessionID &sessionID) throw ( DoNotSend )
 Notification of app message being sent to target. More...
 
void fromAdmin (const Message &message, const SessionID &sessionID) throw ( FieldNotFound, IncorrectDataFormat, IncorrectTagValue, RejectLogon )
 Notification of admin message being received from target. More...
 
void fromApp (const Message &message, const SessionID &sessionID) throw ( FieldNotFound, IncorrectDataFormat, IncorrectTagValue, UnsupportedMessageType )
 Notification of app message being received from target. More...
 
Applicationapp ()
 
- Public Member Functions inherited from FIX::Application
virtual ~Application ()
 

Public Attributes

Mutex m_mutex
 
Applicationm_app
 

Detailed Description

This is a special implementation of the Application interface that takes in another Application interface and synchronizes all of its callbacks.

This will guarantee that only one thread will access the applications code at a time.

This class is a great convenience for writing applications where you don't want to worry about synchronization. There is of course a tradeoff in that you may be synchronizing more than you need to. There is also a very minor performance penalty due to the extra virtual table lookup.

Definition at line 91 of file Application.h.

Constructor & Destructor Documentation

◆ SynchronizedApplication()

FIX::SynchronizedApplication::SynchronizedApplication ( Application app)
inline

Definition at line 94 of file Application.h.

94 { Locker l( m_mutex ); app().fromAdmin( message, sessionID ); }

References app(), FIX::Application::fromAdmin(), and m_mutex.

Referenced by FIX::Application::~Application().

Member Function Documentation

◆ app()

Application& FIX::SynchronizedApplication::app ( )
inline

Definition at line 116 of file Application.h.

116 {}

Referenced by onCreate(), SynchronizedApplication(), and FIX::Application::~Application().

◆ fromAdmin()

void FIX::SynchronizedApplication::fromAdmin ( const Message ,
const SessionID  
)
throw ( FieldNotFound,
IncorrectDataFormat,
IncorrectTagValue,
RejectLogon
)
inlinevirtual

Notification of admin message being received from target.

Implements FIX::Application.

Definition at line 107 of file Application.h.

111  : public Application

◆ fromApp()

void FIX::SynchronizedApplication::fromApp ( const Message ,
const SessionID  
)
throw ( FieldNotFound,
IncorrectDataFormat,
IncorrectTagValue,
UnsupportedMessageType
)
inlinevirtual

Notification of app message being received from target.

Implements FIX::Application.

Definition at line 110 of file Application.h.

111  : public Application
112 {

◆ onCreate()

void FIX::SynchronizedApplication::onCreate ( const SessionID )
inlinevirtual

Notification of a session begin created.

Implements FIX::Application.

Definition at line 96 of file Application.h.

97  { Locker l( m_mutex ); app().fromApp( message, sessionID ); }

References app(), FIX::Application::fromApp(), and m_mutex.

Referenced by FIX::Application::~Application().

◆ onLogon()

void FIX::SynchronizedApplication::onLogon ( const SessionID )
inlinevirtual

Notification of a session successfully logging on.

Implements FIX::Application.

Definition at line 98 of file Application.h.

101  { return m_app; }

Referenced by FIX::Application::~Application().

◆ onLogout()

void FIX::SynchronizedApplication::onLogout ( const SessionID )
inlinevirtual

Notification of a session logging off or disconnecting.

Implements FIX::Application.

Definition at line 100 of file Application.h.

101  { return m_app; }

References m_app.

Referenced by FIX::Application::~Application().

◆ toAdmin()

void FIX::SynchronizedApplication::toAdmin ( Message ,
const SessionID  
)
inlinevirtual

Notification of admin message being sent to target.

Implements FIX::Application.

Definition at line 102 of file Application.h.

111  : public Application

Referenced by FIX::Application::~Application().

◆ toApp()

void FIX::SynchronizedApplication::toApp ( Message ,
const SessionID  
)
throw (DoNotSend
)
inlinevirtual

Notification of app message being sent to target.

Implements FIX::Application.

Definition at line 104 of file Application.h.

111  : public Application

References FIX::NullApplication::onCreate().

Referenced by FIX::Application::~Application().

Member Data Documentation

◆ m_app

Application& FIX::SynchronizedApplication::m_app

Definition at line 117 of file Application.h.

Referenced by onLogout(), and FIX::Application::~Application().

◆ m_mutex

Mutex FIX::SynchronizedApplication::m_mutex

The documentation for this class was generated from the following file:
FIX::SynchronizedApplication::app
Application & app()
Definition: Application.h:116
FIX::SynchronizedApplication::m_mutex
Mutex m_mutex
Definition: Application.h:114
FIX::Application::fromApp
virtual void fromApp(const Message &, const SessionID &)=0
Notification of app message being received from target.
FIX::SynchronizedApplication::m_app
Application & m_app
Definition: Application.h:117
FIX::Application::fromAdmin
virtual void fromAdmin(const Message &, const SessionID &)=0
Notification of admin message being received from target.

Generated on Wed Apr 29 2020 19:41:30 for QuickFIX by doxygen 1.8.16 written by Dimitri van Heesch, © 1997-2001