FIX::ServerWrapper Class Reference

Handles events from SocketMonitor for server connections. More...

Inheritance diagram for FIX::ServerWrapper:
Collaboration diagram for FIX::ServerWrapper:

Public Member Functions

 ServerWrapper (std::set< int > sockets, SocketServer &server, SocketServer::Strategy &strategy)
Public Member Functions inherited from FIX::SocketMonitor::Strategy
virtual ~Strategy ()

Private Types

typedef std::set< int > Sockets

Private Member Functions

void onConnect (SocketMonitor &, int socket)
void onEvent (SocketMonitor &monitor, int socket)
void onWrite (SocketMonitor &, int socket)
void onError (SocketMonitor &monitor, int socket)
void onError (SocketMonitor &)
void onTimeout (SocketMonitor &)

Private Attributes

Sockets m_sockets
SocketServerm_server
SocketServer::Strategym_strategy

Detailed Description

Handles events from SocketMonitor for server connections.

Definition at line 40 of file SocketServer.cpp.

Member Typedef Documentation

◆ Sockets

typedef std::set<int> FIX::ServerWrapper::Sockets
private

Definition at line 87 of file SocketServer.cpp.

Constructor & Destructor Documentation

◆ ServerWrapper()

FIX::ServerWrapper::ServerWrapper ( std::set< int > sockets,
SocketServer & server,
SocketServer::Strategy & strategy )
inline

Definition at line 43 of file SocketServer.cpp.

45: m_sockets( sockets ), m_server( server ), m_strategy( strategy ) {}
SocketServer::Strategy & m_strategy
SocketServer & m_server

References m_server, m_sockets, and m_strategy.

Member Function Documentation

◆ onConnect()

void FIX::ServerWrapper::onConnect ( SocketMonitor & ,
int socket )
inlineprivatevirtual

Implements FIX::SocketMonitor::Strategy.

Definition at line 48 of file SocketServer.cpp.

49 {
50 }

◆ onError() [1/2]

void FIX::ServerWrapper::onError ( SocketMonitor & )
inlineprivatevirtual

Implements FIX::SocketMonitor::Strategy.

Definition at line 76 of file SocketServer.cpp.

77 {
78 m_strategy.onError( m_server );
79 }

References m_server, and m_strategy.

◆ onError() [2/2]

void FIX::ServerWrapper::onError ( SocketMonitor & monitor,
int socket )
inlineprivatevirtual

Implements FIX::SocketMonitor::Strategy.

Definition at line 70 of file SocketServer.cpp.

71 {
72 m_strategy.onDisconnect( m_server, socket );
73 monitor.drop( socket );
74 }

References FIX::SocketMonitor::drop(), m_server, and m_strategy.

Referenced by onEvent().

◆ onEvent()

void FIX::ServerWrapper::onEvent ( SocketMonitor & monitor,
int socket )
inlineprivatevirtual

Implements FIX::SocketMonitor::Strategy.

Definition at line 52 of file SocketServer.cpp.

53 {
54 if( m_sockets.find(socket) != m_sockets.end() )
55 {
56 m_strategy.onConnect( m_server, socket, m_server.accept(socket) );
57 }
58 else
59 {
60 if( !m_strategy.onData( m_server, socket ) )
61 onError( monitor, socket );
62 }
63 }
void onError(SocketMonitor &monitor, int socket)

References m_server, m_sockets, m_strategy, and onError().

◆ onTimeout()

void FIX::ServerWrapper::onTimeout ( SocketMonitor & )
inlineprivatevirtual

Reimplemented from FIX::SocketMonitor::Strategy.

Definition at line 81 of file SocketServer.cpp.

82 {
83 m_strategy.onTimeout( m_server );
84 };

References m_server, and m_strategy.

◆ onWrite()

void FIX::ServerWrapper::onWrite ( SocketMonitor & ,
int socket )
inlineprivatevirtual

Implements FIX::SocketMonitor::Strategy.

Definition at line 65 of file SocketServer.cpp.

66 {
67 m_strategy.onWrite( m_server, socket );
68 }

References m_server, and m_strategy.

Member Data Documentation

◆ m_server

SocketServer& FIX::ServerWrapper::m_server
private

Definition at line 90 of file SocketServer.cpp.

Referenced by onError(), onError(), onEvent(), onTimeout(), onWrite(), and ServerWrapper().

◆ m_sockets

Sockets FIX::ServerWrapper::m_sockets
private

Definition at line 89 of file SocketServer.cpp.

Referenced by onEvent(), and ServerWrapper().

◆ m_strategy

SocketServer::Strategy& FIX::ServerWrapper::m_strategy
private

Definition at line 91 of file SocketServer.cpp.

Referenced by onError(), onError(), onEvent(), onTimeout(), onWrite(), and ServerWrapper().


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

Generated on for QuickFIX by doxygen 1.15.0 written by Dimitri van Heesch, © 1997-2001