Public Member Functions | Private Types | Private Member Functions | Private Attributes
FIX::ServerWrapper Class Reference

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

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

List of all members.

Public Member Functions

 ServerWrapper (std::set< int > sockets, SocketServer &server, SocketServer::Strategy &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

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

Definition at line 84 of file SocketServer.cpp.


Constructor & Destructor Documentation

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

Definition at line 43 of file SocketServer.cpp.

: m_sockets( sockets ), m_server( server ), m_strategy( strategy ) {}

Member Function Documentation

void FIX::ServerWrapper::onConnect ( SocketMonitor ,
int  socket 
) [inline, private, virtual]

Implements FIX::SocketMonitor::Strategy.

Definition at line 48 of file SocketServer.cpp.

  {
  }
void FIX::ServerWrapper::onError ( SocketMonitor monitor,
int  socket 
) [inline, private, virtual]

Implements FIX::SocketMonitor::Strategy.

Definition at line 70 of file SocketServer.cpp.

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

Referenced by onEvent().

  {
    m_strategy.onDisconnect( m_server, socket );
    monitor.drop( socket );
  }
void FIX::ServerWrapper::onError ( SocketMonitor ) [inline, private, virtual]
void FIX::ServerWrapper::onEvent ( SocketMonitor monitor,
int  socket 
) [inline, private, virtual]

Implements FIX::SocketMonitor::Strategy.

Definition at line 52 of file SocketServer.cpp.

References FIX::SocketServer::accept(), m_server, m_sockets, m_strategy, FIX::SocketServer::Strategy::onConnect(), FIX::SocketServer::Strategy::onData(), and onError().

  {
    if( m_sockets.find(socket) != m_sockets.end() )
    {
      m_strategy.onConnect( m_server, socket, m_server.accept(socket) );
    }
    else
    {
      if( !m_strategy.onData( m_server, socket ) )
        onError( monitor, socket );
    }
  }
void FIX::ServerWrapper::onTimeout ( SocketMonitor ) [inline, private, virtual]
void FIX::ServerWrapper::onWrite ( SocketMonitor ,
int  socket 
) [inline, private, virtual]

Member Data Documentation

Definition at line 90 of file SocketServer.cpp.

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

Definition at line 89 of file SocketServer.cpp.

Referenced by onEvent().

Definition at line 91 of file SocketServer.cpp.

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


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

Generated on Mon Sep 15 2014 01:23:57 for QuickFIX by doxygen 1.7.6.1 written by Dimitri van Heesch, © 1997-2001