Index  Source Files  Annotated Class List  Alphabetical Class List  Class Hierarchy  Graphical Class Hierarchy 

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 41 of file SocketServer.cpp.


Member Typedef Documentation

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

Definition at line 97 of file SocketServer.cpp.


Constructor & Destructor Documentation

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

Definition at line 44 of file SocketServer.cpp.

00046 : 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 49 of file SocketServer.cpp.

References QF_STACK_POP, and QF_STACK_PUSH.

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

Implements FIX::SocketMonitor::Strategy.

Definition at line 78 of file SocketServer.cpp.

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

Referenced by onError(), and onEvent().

00079   { QF_STACK_PUSH(ServerWrapper::onError)
00080 
00081     m_strategy.onDisconnect( m_server, socket );
00082     monitor.drop( socket );
00083 
00084     QF_STACK_POP
00085   }

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

Implements FIX::SocketMonitor::Strategy.

Definition at line 54 of file SocketServer.cpp.

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

00055   { QF_STACK_PUSH(ServerWrapper::onEvent)
00056 
00057     if( m_sockets.find(socket) != m_sockets.end() )
00058     {
00059       m_strategy.onConnect( m_server, socket, m_server.accept(socket) );
00060     }
00061     else
00062     {
00063       if( !m_strategy.onData( m_server, socket ) )
00064         onError( monitor, socket );
00065     }
00066 
00067     QF_STACK_POP
00068   }

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

Member Data Documentation

Definition at line 103 of file SocketServer.cpp.

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

Definition at line 102 of file SocketServer.cpp.

Referenced by onEvent().

Definition at line 104 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 Apr 5 21:00:12 2010 for QuickFIX by doxygen 1.6.1 written by Dimitri van Heesch, © 1997-2001