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:
[legend]
Collaboration diagram for FIX::SynchronizedApplication:
[legend]

## Public Member Functions

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

## Public Attributes

Mutex | m_mutex
Application & | m_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 76 of file Application.h.

## Constructor & Destructor Documentation

## SynchronizedApplication()

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

inline

Definition at line 79 of file Application.h.

: m_app( app ) {}
FIX::SynchronizedApplication::m_app
Application & m_app
Definition Application.h:102
FIX::SynchronizedApplication::app
Application & app()
Definition Application.h:101

## Member Function Documentation

## app()

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

inline

Definition at line 101 of file Application.h.

{ return m_app; }

References m_app.

Referenced by fromAdmin(), fromApp(), onCreate(), onLogon(), onLogout(), toAdmin(), and toApp().

## fromAdmin()

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

inline virtual

Notification of admin message being received from target.

Implements FIX::Application.

Definition at line 92 of file Application.h.

{ Locker l( m_mutex ); app().fromAdmin( message, sessionID ); }
FIX::Application::fromAdmin
virtual void fromAdmin(const Message &, const SessionID &)=0
Notification of admin message being received from target.
FIX::SynchronizedApplication::m_mutex
Mutex m_mutex
Definition Application.h:99

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

## fromApp()

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

inline virtual

Notification of app message being received from target.

Implements FIX::Application.

Definition at line 95 of file Application.h.

{ Locker l( m_mutex ); app().fromApp( message, sessionID ); }
FIX::Application::fromApp
virtual void fromApp(const Message &, const SessionID &)=0
Notification of app message being received from target.

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

## onCreate()

void FIX::SynchronizedApplication::onCreate | ( | const SessionID & |  | ) |

inline virtual

Notification of a session begin created.

Implements FIX::Application.

Definition at line 81 of file Application.h.

{ Locker l( m_mutex ); app().onCreate( sessionID ); }
FIX::Application::onCreate
virtual void onCreate(const SessionID &)=0
Notification of a session begin created.

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

## onLogon()

void FIX::SynchronizedApplication::onLogon | ( | const SessionID & |  | ) |

inline virtual

Notification of a session successfully logging on.

Implements FIX::Application.

Definition at line 83 of file Application.h.

{ Locker l( m_mutex ); app().onLogon( sessionID ); }
FIX::Application::onLogon
virtual void onLogon(const SessionID &)=0
Notification of a session successfully logging on.

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

## onLogout()

void FIX::SynchronizedApplication::onLogout | ( | const SessionID & |  | ) |

inline virtual

Notification of a session logging off or disconnecting.

Implements FIX::Application.

Definition at line 85 of file Application.h.

{ Locker l( m_mutex ); app().onLogout( sessionID ); }
FIX::Application::onLogout
virtual void onLogout(const SessionID &)=0
Notification of a session logging off or disconnecting.

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

## toAdmin()

void FIX::SynchronizedApplication::toAdmin | ( | Message & | ,
|  | const SessionID & |
| ) |  |

inline virtual

Notification of admin message being sent to target.

Implements FIX::Application.

Definition at line 87 of file Application.h.

{ Locker l( m_mutex ); app().toAdmin( message, sessionID ); }
FIX::Application::toAdmin
virtual void toAdmin(Message &, const SessionID &)=0
Notification of admin message being sent to target.

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

## toApp()

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

inline virtual

Notification of app message being sent to target.

Implements FIX::Application.

Definition at line 89 of file Application.h.

{ Locker l( m_mutex ); app().toApp( message, sessionID ); }
FIX::Application::toApp
virtual void toApp(Message &, const SessionID &)=0
Notification of app message being sent to target.

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

## Member Data Documentation

## m_app

Application& FIX::SynchronizedApplication::m_app

Definition at line 102 of file Application.h.

Referenced by app().

## m_mutex

Mutex FIX::SynchronizedApplication::m_mutex

Definition at line 99 of file Application.h.

Referenced by fromAdmin(), fromApp(), onCreate(), onLogon(), onLogout(), toAdmin(), and toApp().

The documentation for this class was generated from the following file:

- Application.h