News SF.net Project Frequently Asked Questions Documentation Downloads Mailing Lists How to Contribute

SourceForge.net Logo

Changing the way games are made and played.

TNL::StringTableEntry class Reference

TNL::StringTableEntry Class Reference

#include <tnlNetStringTable.h>


Detailed Description

The StringTableEntry class encapsulates an entry in the network StringTable.

StringTableEntry instances offer several benefits over normal strings in a networked simulation. First, the ConnectionStringTable class is able to cache string transfers, meaning that recently used strings will be transmitted as string data once and then referred to by a short id bitfield thereafter. String comparison operations are also much less expensive with StringTableEntry instances as they result in just a single integer comparison.


Public Member Functions

 StringTableEntry ()
 empty constructor gets NULL string automatically.

 StringTableEntry (const char *string, bool caseSensitive=true)
 StringTableEntry (const StringTableEntry &theString)
StringTableEntryoperator= (const StringTableEntry &s)
StringTableEntryoperator= (const char *string)
void set (const char *string, bool caseSensitive=true)
void setn (const char *string, U32 len, bool caseSensitive=true)
bool operator== (const StringTableEntry &s) const
bool operator!= (const StringTableEntry &s) const
bool isNull () const
bool isNotNull () const
bool isValid () const
 operator bool () const
void decRef ()
void incRef ()
U32 getIndex () const
const char * getString () const

Private Attributes

StringTableEntryId mIndex
 index of the string table entry in the master pointer list


Constructor & Destructor Documentation

TNL::StringTableEntry::StringTableEntry  )  [inline]
 

empty constructor gets NULL string automatically.

TNL::StringTableEntry::StringTableEntry const char *  string,
bool  caseSensitive = true
[inline]
 

TNL::StringTableEntry::StringTableEntry const StringTableEntry theString  )  [inline]
 


Member Function Documentation

StringTableEntry& TNL::StringTableEntry::operator= const StringTableEntry s  )  [inline]
 

StringTableEntry& TNL::StringTableEntry::operator= const char *  string  )  [inline]
 

void TNL::StringTableEntry::set const char *  string,
bool  caseSensitive = true
[inline]
 

void TNL::StringTableEntry::setn const char *  string,
U32  len,
bool  caseSensitive = true
[inline]
 

bool TNL::StringTableEntry::operator== const StringTableEntry s  )  const [inline]
 

bool TNL::StringTableEntry::operator!= const StringTableEntry s  )  const [inline]
 

bool TNL::StringTableEntry::isNull  )  const [inline]
 

bool TNL::StringTableEntry::isNotNull  )  const [inline]
 

bool TNL::StringTableEntry::isValid  )  const [inline]
 

TNL::StringTableEntry::operator bool  )  const [inline]
 

void TNL::StringTableEntry::decRef  )  [inline]
 

void TNL::StringTableEntry::incRef  )  [inline]
 

U32 TNL::StringTableEntry::getIndex  )  const [inline]
 

const char* TNL::StringTableEntry::getString  )  const [inline]
 


Field Documentation

StringTableEntryId TNL::StringTableEntry::mIndex [private]
 

index of the string table entry in the master pointer list