Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

CNetworkPlayer Class Reference

CNetworkPlayer. More...

#include <NetworkPlayer.h>

Inheritance diagram for CNetworkPlayer:

CPlayer CParamable CGenericTask CTournamentPlayer List of all members.

Public Member Functions

 CNetworkPlayer (CBSock *pBSock)
 CNetworkPlayer.
virtual ~CNetworkPlayer (void)
 ~CNetworkPlayer
CBSockGetNetworkSock () const
 GetNetworkSock.

Protected Member Functions

bool OnInit ()
 OnInit.
void OnMessageReceived (CMessage *pMsg)
 OnMessageReceived.
void OnForegroundProc ()
 OnForegroundProc.
void PostANetworkMsg (const CMessage *pMsg)
 PostANetworkMsg.

Detailed Description

CNetworkPlayer.

Description: The CNetowrkPlayer class conforms to the player communication interface. The class provides for internet routing of system messages.

Limitations: None


Constructor & Destructor Documentation

CNetworkPlayer::CNetworkPlayer CBSock pSock  ) 
 

CNetworkPlayer.

Description: The constructor initializes internal attributes.

Returns:
void
Limitations: None

CNetworkPlayer::~CNetworkPlayer void   )  [virtual]
 

~CNetworkPlayer

Description: This destructor has been included for maintenance only.

Returns:
void
Limitations: None


Member Function Documentation

CBSock * CNetworkPlayer::GetNetworkSock  )  const [inline]
 

GetNetworkSock.

Description: : This function returns a pointer to the attached CBSock.

Returns:
CBSock*: The pointer to the attached socket.
Limitations: None

void CNetworkPlayer::OnForegroundProc  )  [protected, virtual]
 

OnForegroundProc.

Description: This handler function is called during each iteration of the player thread's execution loop. In this function, the network connection CBSock's process function is called and the player checks to see if any network messages can be received.

Returns:
void
Limitations: None

Reimplemented from CPlayer.

bool CNetworkPlayer::OnInit  )  [protected, virtual]
 

OnInit.

Description: The OnInit function is called right when the thread is started. This version of the function verifies that a CBSock object has been attached via the constructor.

Returns:
bool: true if the player has been initialized, else false. A return value of false will prevent the player thread from executing.
Limitations: None

Reimplemented from CPlayer.

void CNetworkPlayer::OnMessageReceived CMessage pMsg  )  [protected, virtual]
 

OnMessageReceived.

Description: This handler function is called when a message has been received by the host sent to the client (player). In this version of the function, the received message is written out over the network through a CBSock object. The CBSock's process function is callled after sending to speed up msg delivery.

Parameters:
pMsg - The message that has been received and is to be forwarded over the network to a receiving NetworkPlayer
Returns:
Void
Limitations: None

Reimplemented from CPlayer.

void CNetworkPlayer::PostANetworkMsg const CMessage pMsg  )  [protected]
 

PostANetworkMsg.

Description: This function posts a message over the network through the network player's CBSock connection.

Parameters:
pMsg,: The message to be sent.
Returns:
void.
Limitations: None


The documentation for this class was generated from the following files:
Copyright (c) 2005 Matt Bruns, Pat Hammond, Kevin Markussen, Travis Service, Brain Shaver

SourceForge.net Logo