OpenMortal Apocalypse mirror
Sourceforge mirror
SourceForge.net Logo
      News | Info | Characters | Arenas | Screenshots | Forums | Download  
Developer: Making of | Character-HOWTO | AI Design | Submit a Character
Documentation: Main Page | Modules | Class Hierarchy | Class List | File List

COnlineChatBEImpl Class Reference
[Networking layer]

Implementation of the COnlineChatBE interface. More...

#include <OnlineChatBEImpl.h>

Inheritance diagram for COnlineChatBEImpl:

IOnlineChatBE List of all members.

Public Member Functions

 COnlineChatBEImpl ()
 ~COnlineChatBEImpl ()
virtual void connect (std::string a_sNick)
virtual void disconnect ()
virtual ConnectionStateEnum getConnectionState () const
virtual std::string getMyNick () const
virtual void setMyNick (std::string a_sNick)
virtual ClientModeEnum getMyClientMode () const
virtual void setMyClientMode (ClientModeEnum a_enClientMode)
virtual const UserInfo & getMyUserInfo () const
 Same as getUserInfo(0).
virtual int getUserCount () const
virtual const UserInfo & getUserInfo (int a_iUserNumber) const
virtual ClientModeEnum getClientMode () const
virtual void setClientMode (ClientModeEnum a_enNewMode)
virtual void addEventSink (IOnlineEventSink *a_poSink)
virtual void removeEventSink (IOnlineEventSink *a_poSink)
virtual void removeAllEventSinks ()

Protected Types

typedef std::list< IOnlineEventSink * > EventSinkList
typedef std::list< UserInfo * > UserInfoList

Protected Member Functions

void notifyEvent (const IOnlineChatBE::SChatEvent &a_roEvent)
void notifyConnectionState (IOnlineChatBE::ConnectionStateEnum a_enOldState, IOnlineChatBE::ConnectionStateEnum a_enNewState, const std::string &a_rsMessage)
void notifyConnectionState (const std::string &a_rsMessage)
void threadFunction ()
void internalConnect ()
 internalConnect establishes the connection to the server.
void internalDisconnect ()
void internalProcessMessage ()
 Reads one message from the server and processes it.
void sendNick ()
void sendRawData (char a_cPrefix, const char *a_pcMessage)

Protected Attributes

ConnectionStateEnum m_enConnectionState
ConnectionStateEnum m_enNotifiedState
ClientModeEnum m_enClientMode
std::string m_sMyNick
EventSinkList m_apoSinks
UserInfoList m_apoUsers
TCPsocket m_poSocket
SDLNet_SocketSet m_poSocketSet
char m_acIncomingBuffer [4096]
 Received data goes here.
int m_iIncomingBufferSize
 How much of the buffer is filled?
SDL_mutex * m_poLock

Detailed Description

Implementation of the COnlineChatBE interface.

Author:
upi


Member Typedef Documentation

typedef std::list<IOnlineEventSink*> COnlineChatBEImpl::EventSinkList [protected]
 

typedef std::list<UserInfo*> COnlineChatBEImpl::UserInfoList [protected]
 


Constructor & Destructor Documentation

COnlineChatBEImpl::COnlineChatBEImpl  ) 
 

COnlineChatBEImpl::~COnlineChatBEImpl  ) 
 


Member Function Documentation

void COnlineChatBEImpl::addEventSink IOnlineEventSink a_poSink  )  [virtual]
 

Implements IOnlineChatBE.

void COnlineChatBEImpl::connect std::string  a_sNick  )  [virtual]
 

Implements IOnlineChatBE.

void COnlineChatBEImpl::disconnect  )  [virtual]
 

Implements IOnlineChatBE.

IOnlineChatBE::ClientModeEnum COnlineChatBEImpl::getClientMode  )  const [virtual]
 

Implements IOnlineChatBE.

IOnlineChatBE::ConnectionStateEnum COnlineChatBEImpl::getConnectionState  )  const [virtual]
 

Implements IOnlineChatBE.

IOnlineChatBE::ClientModeEnum COnlineChatBEImpl::getMyClientMode  )  const [virtual]
 

Implements IOnlineChatBE.

std::string COnlineChatBEImpl::getMyNick  )  const [virtual]
 

Implements IOnlineChatBE.

const IOnlineChatBE::UserInfo & COnlineChatBEImpl::getMyUserInfo  )  const [virtual]
 

Same as getUserInfo(0).

Implements IOnlineChatBE.

int COnlineChatBEImpl::getUserCount  )  const [virtual]
 

Implements IOnlineChatBE.

const IOnlineChatBE::UserInfo & COnlineChatBEImpl::getUserInfo int  a_iUserNumber  )  const [virtual]
 

Implements IOnlineChatBE.

void COnlineChatBEImpl::internalConnect  )  [protected]
 

internalConnect establishes the connection to the server.

It is assumed that the client is NOT connected before this method is called. Successful execution sets the m_poSocket and other connection related attributes, and the m_enConnectionState to CS_Connected

void COnlineChatBEImpl::internalDisconnect  )  [protected]
 

void COnlineChatBEImpl::internalProcessMessage  )  [protected]
 

Reads one message from the server and processes it.

void COnlineChatBEImpl::notifyConnectionState const std::string &  a_rsMessage  )  [protected]
 

void COnlineChatBEImpl::notifyConnectionState IOnlineChatBE::ConnectionStateEnum  a_enOldState,
IOnlineChatBE::ConnectionStateEnum  a_enNewState,
const std::string &  a_rsMessage
[protected]
 

void COnlineChatBEImpl::notifyEvent const IOnlineChatBE::SChatEvent a_roEvent  )  [protected]
 

void COnlineChatBEImpl::removeAllEventSinks  )  [virtual]
 

Implements IOnlineChatBE.

void COnlineChatBEImpl::removeEventSink IOnlineEventSink a_poSink  )  [virtual]
 

Implements IOnlineChatBE.

void COnlineChatBEImpl::sendNick  )  [protected]
 

void COnlineChatBEImpl::sendRawData char  a_cPrefix,
const char *  a_pcMessage
[protected]
 

void COnlineChatBEImpl::setClientMode ClientModeEnum  a_enNewMode  )  [virtual]
 

Implements IOnlineChatBE.

void COnlineChatBEImpl::setMyClientMode ClientModeEnum  a_enClientMode  )  [virtual]
 

void COnlineChatBEImpl::setMyNick std::string  a_sNick  )  [virtual]
 

Implements IOnlineChatBE.

void COnlineChatBEImpl::threadFunction  )  [protected]
 


Member Data Documentation

char COnlineChatBEImpl::m_acIncomingBuffer[4096] [protected]
 

Received data goes here.

EventSinkList COnlineChatBEImpl::m_apoSinks [protected]
 

UserInfoList COnlineChatBEImpl::m_apoUsers [protected]
 

ClientModeEnum COnlineChatBEImpl::m_enClientMode [protected]
 

ConnectionStateEnum COnlineChatBEImpl::m_enConnectionState [protected]
 

ConnectionStateEnum COnlineChatBEImpl::m_enNotifiedState [protected]
 

int COnlineChatBEImpl::m_iIncomingBufferSize [protected]
 

How much of the buffer is filled?

SDL_mutex* COnlineChatBEImpl::m_poLock [protected]
 

TCPsocket COnlineChatBEImpl::m_poSocket [protected]
 

SDLNet_SocketSet COnlineChatBEImpl::m_poSocketSet [protected]
 

std::string COnlineChatBEImpl::m_sMyNick [protected]
 


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