VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Protected Attributes
DtSymbolString Class Reference

This class allows one to collect and compare strings using an index number instead of having to do string compares. It is not virtual and is effectively 4 bytes meaning you can pass these by value as easily as passing a pointer.

When a symbol string is created from a string, the string is stored inside of a table of strings (managed by DtSymbolStore) and the symbol string is given a key with which to get the associated string from the table. As a result, unique strings are stored only once. This can result in significant memory savings if many instances of the same string were formerly stored in the system. Additionally, because each symbol string references its string by a key, string comparison becomes key comparison (much more efficient). In general, the symbol string classes are used in the reader/writer classes and the DtSpecification classes. You should not have to update code to use the DtSymbolStrings, other than to provide the appropriate functions if any classes were derived from reader/writer classes implementing member functions using DtSymbolStrings.

Public Member Functions

 DtSymbolString ()
 
 DtSymbolString (const DtString &str)
 
 DtSymbolString (unsigned int i)
 
 ~DtSymbolString ()
 
 DtSymbolString (const DtSymbolString &orig)
 
DtSymbolStringoperator= (const DtString &orig)
 
DtSymbolStringoperator= (const char *orig)
 
 operator const char * () const
 
const charc_str () const
 
const charstring () const
 
const unsigned int symbol () const
 
DtSymbolStringclone ()
 
bool operator== (const DtString &str) const
 
bool operator!= (const DtString &str) const
 
bool operator== (const char *str) const
 
bool operator!= (const char *str) const
 
bool operator== (const DtSymbolString &str) const
 
bool operator!= (const DtSymbolString &str) const
 
bool operator< (const DtSymbolString &str) const
 

Protected Attributes

unsigned int mySymbol
 

Constructor & Destructor Documentation

DtSymbolString::DtSymbolString ( )
DtSymbolString::DtSymbolString ( const DtString str)
DtSymbolString::DtSymbolString ( unsigned int  i)
DtSymbolString::~DtSymbolString ( )
DtSymbolString::DtSymbolString ( const DtSymbolString orig)

Member Function Documentation

DtSymbolString& DtSymbolString::operator= ( const DtString orig)
DtSymbolString& DtSymbolString::operator= ( const char orig)
DtSymbolString::operator const char * ( ) const
const char* DtSymbolString::c_str ( ) const
const char* DtSymbolString::string ( ) const
const unsigned int DtSymbolString::symbol ( ) const
inline
DtSymbolString* DtSymbolString::clone ( )
bool DtSymbolString::operator== ( const DtString str) const
bool DtSymbolString::operator!= ( const DtString str) const
bool DtSymbolString::operator== ( const char str) const
bool DtSymbolString::operator!= ( const char str) const
bool DtSymbolString::operator== ( const DtSymbolString str) const
bool DtSymbolString::operator!= ( const DtSymbolString str) const
bool DtSymbolString::operator< ( const DtSymbolString str) const

Member Data Documentation

unsigned int DtSymbolString::mySymbol
protected

The documentation for this class was generated from the following file:

Document ID: Generated on Wed Mar 27 22:49:11 EDT 2024 from SVN revision 264633
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)