ConnectionStringTable Class Reference

#include <connectionStringTable.h>

List of all members.


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

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

Public Member Functions

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

Private Member Functions

void pushBack (Entry *entry)

Private Attributes

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

Classes

struct  Entry


Member Enumeration Documentation

Enumerator:
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 ( NetStringHandle string,
U32  index 
) [inline]

Has the specified string been received on the other side?

U32 ConnectionStringTable::checkString ( NetStringHandle stringTableId,
bool stringOnOtherSide = NULL 
)

Checks if the global string ID is.

U32 ConnectionStringTable::getNetSendId ( NetStringHandle stringTableId  ) 

currently valid for this connection and returns the table ID. Same return value as checkString

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

void ConnectionStringTable::mapString ( U32  netId,
NetStringHandle string 
)

but will assert if the string is not valid. Maps a string that

NetStringHandle ConnectionStringTable::lookupString ( U32  netId  )  [inline]

was just sent over the net to the corresponding net ID.

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  ) 


Member Data Documentation

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

Connection over which we are maintaining this string table.