torque Torque Game Engine Documentation
CVS Revision Label 1.3.x

ConnectionStringTable Class Reference

#include <connectionStringTable.h>


Detailed Description

Maintain a table of strings which are shared across the network.

This allows us to reference strings in our network streams more efficiently.


Public Types

enum  Constants {
  EntryCount = 32,
  EntryBitSize = 5,
  InvalidEntryId = 32
}

Public Member Functions

 ConnectionStringTable (NetConnection *parent)
 Initialize the connection string table.
void confirmStringReceived (StringHandle &string, U32 index)
 Has the specified string been received on the other side?
U32 checkString (StringHandle &stringTableId, bool *stringOnOtherSide=NULL)
 Checks if the global string ID is currently valid for this connection and returns the table ID.
U32 getNetSendId (StringHandle &stringTableId)
 Same return value as checkString but will assert if the string is not valid.
void mapString (U32 netId, StringHandle &string)
 Maps a string that was just sent over the net to the corresponding net ID.
StringHandle lookupString (U32 netId)
Demo functionality
void readDemoStartBlock (BitStream *stream)
void writeDemoStartBlock (ResizeBitStream *stream)

Private Member Functions

void pushBack (Entry *entry)

Private Attributes

Entry mEntryTable [EntryCount]
EntrymHashTable [EntryCount]
StringHandle mRemoteStringTable [EntryCount]
Entry mLRUHead
Entry mLRUTail
NetConnectionmParent
 Connection over which we are maintaining this string table.

Data Structures

struct  Entry


Member Enumeration Documentation

enum ConnectionStringTable::Constants
 

Enumeration values:
EntryCount 
EntryBitSize 
InvalidEntryId 


Constructor & Destructor Documentation

ConnectionStringTable::ConnectionStringTable NetConnection parent  ) 
 

Initialize the connection string table.

Parameters:
parent Connection over which we are maintaining this string table.


Member Function Documentation

void ConnectionStringTable::pushBack Entry entry  )  [inline, private]
 

void ConnectionStringTable::confirmStringReceived StringHandle string,
U32  index
[inline]
 

Has the specified string been received on the other side?

U32 ConnectionStringTable::checkString StringHandle stringTableId,
bool *  stringOnOtherSide = NULL
 

Checks if the global string ID is currently valid for this connection and returns the table ID.

Sends a string event to the other side if it is not active. It will fill in stringOnOtherSide.

U32 ConnectionStringTable::getNetSendId StringHandle stringTableId  ) 
 

Same return value as checkString but will assert if the string is not valid.

void ConnectionStringTable::mapString U32  netId,
StringHandle string
 

Maps a string that was just sent over the net to the corresponding net ID.

StringHandle ConnectionStringTable::lookupString U32  netId  )  [inline]
 

the global string table ID for that string.

Parameters:
netId  looks up the string ID and returns

void ConnectionStringTable::readDemoStartBlock BitStream stream  ) 
 

void ConnectionStringTable::writeDemoStartBlock ResizeBitStream stream  ) 
 


Field Documentation

Entry ConnectionStringTable::mEntryTable[EntryCount] [private]
 

Entry* ConnectionStringTable::mHashTable[EntryCount] [private]
 

StringHandle ConnectionStringTable::mRemoteStringTable[EntryCount] [private]
 

Entry ConnectionStringTable::mLRUHead [private]
 

Entry ConnectionStringTable::mLRUTail [private]
 

NetConnection* ConnectionStringTable::mParent [private]
 

Connection over which we are maintaining this string table.




All Rights Reserved GarageGames.com, Inc. 1999-2005
Auto-magically Generated with Doxygen