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

CCaffeineGUIHelper Class Reference

CCaffeineGUIHelper. More...

#include <CaffeineGUIHelper.h>

List of all members.

Public Member Functions

 CCaffeineGUIHelper (uint32 stuID, const int8 *name, uint32 nameLength, CaffeineGUID gameID)
 CCaffeineGUIHelper.
 ~CCaffeineGUIHelper (void)
 ~CCaffeineGUIHelper
bool Connect (const int8 *ipAddr=NULL)
 Connect.
void Disconnect ()
 Disconnect.
void SendMove (const CMove *)
 SendMove.
void DeclareInvalidMove (const CMove *)
 DeclareInvalidMove.
bool IsEventPending ()
 IsEventPending.
bool GetNextEvent (CHelperEvent &event)
 GetNextEvent.
void Process ()
 Process.
bool RegisterCustomEvent (uint32 msgType, uint32 helperEventType)
 RegisterCustomEvent.
const int8 *const GetConnectError () const
 GetConnectError.

Protected Member Functions

bool ConnectToClient (const int8 *ipAddr)
 ConnectAsPlayer.
void PostIdentity ()
 PostIdentity.


Detailed Description

CCaffeineGUIHelper.

Description: This class is a helper class that enables easy communication to a Caffeine Client.

Limitations: NONE


Constructor & Destructor Documentation

CCaffeineGUIHelper::CCaffeineGUIHelper uint32  stuID,
const int8 *  name,
uint32  nameLength,
CaffeineGUID  gameID
 

CCaffeineGUIHelper.

Description: Class constructor

Parameters:
stuID is the student ID of the player
name is the name of the player (Null terminated)
nameLength is the length of the name variable
Limitations: Needs to be run from a QThread.

CCaffeineGUIHelper::~CCaffeineGUIHelper void   ) 
 

~CCaffeineGUIHelper

Description: Class deconstructor

Limitations: NONE


Member Function Documentation

bool CCaffeineGUIHelper::Connect const int8 *  ipAddr = NULL  ) 
 

Connect.

Description: Connects to a Caffeine Client and authenticates this connection.

Parameters:
ipAddr is set to the IP address of the Caffeine Client if the GUI is supposed to be a spectator. Do not set this value if the GUI is a player. Players must connect to a Caffeine Client on the local machine.
Returns:
True if the connection is established successfully and false otherwise.
Limitations: NONE

bool CCaffeineGUIHelper::ConnectToClient const int8 *  ipAddr  )  [protected]
 

ConnectAsPlayer.

Description: Connect to the Caffeine client

Parameters:
ipAddr is the address connect to the client at.
Returns:
True if the connection is established successfully and false otherwise.
Limitations: NONE

void CCaffeineGUIHelper::DeclareInvalidMove const CMove pMove  ) 
 

DeclareInvalidMove.

Description: Declares a move to be invalid by sending the proper message to the Caffeine Client.

Parameters:
pMove the invalid move to send.
Returns:
void
Limitations: NONE

void CCaffeineGUIHelper::Disconnect  ) 
 

Disconnect.

Description: Disconnects the GUI from the Caffeine Client.

Returns:
void
Limitations: Calls the CleanupNetwork function, so if you want to use Caffeine network connection code after this you must call InitNetwork first.

const int8 *const CCaffeineGUIHelper::GetConnectError  )  const
 

GetConnectError.

Description: Returns the last error message generated.

Returns:
The last error message generated
Limitations: NONE

bool CCaffeineGUIHelper::GetNextEvent CHelperEvent event  ) 
 

GetNextEvent.

Description: Returns the next pending event.

Returns:
The next pending event for the GUI.
Limitations: Should not call this function if there is no messages pending.

bool CCaffeineGUIHelper::IsEventPending  ) 
 

IsEventPending.

Description: Returns whether there is an event pending for the GUI to receive.

Returns:
True if there is an event waiting to be received.
Limitations: NONE

void CCaffeineGUIHelper::PostIdentity  )  [protected]
 

PostIdentity.

Description: Posts the identity of this GUI to the Caffeine Client

Returns:
void
Limitations: The variable m_ID should be set with the correct information.

void CCaffeineGUIHelper::Process  ) 
 

Process.

Description: Processes incoming messages from the Caffeine framework and converts pertinant ones into CHelperEvents.

Returns:
void
Limitations: NONE

bool CCaffeineGUIHelper::RegisterCustomEvent uint32  msgType,
uint32  helperEventType
 

RegisterCustomEvent.

Description: Registers a custom event type that the GUI would like to receive in response to a Caffeine message type received.

Parameters:
msgType is the type identifier of a Caffeine message that should generate the event.
helperEventType is the type identifier of the helper event generated when the Caffeine message is received.
Returns:
True if the event is successfully registered and false otherwise.
Limitations: NONE

void CCaffeineGUIHelper::SendMove const CMove pMove  ) 
 

SendMove.

Description: Sends the move to the Caffeine Client.

Parameters:
pMove the move to send.
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