Jamoma API  0.6.0.a19
TTSymbolBase Class Reference

The TTSymbolBase class is used to represent a string and efficiently pass and compare that string. More...

#include <TTSymbolBase.h>

+ Inheritance diagram for TTSymbolBase:

Public Member Functions

 TTSymbolBase (const TTString &newString, TTPtrSizedInt newSymbolTableId, TTInt32 newSymbolId)
 The constructor is intended only for use by the TTSymbolBaseTable object when creating new symbols in the table. More...
 
 TTSymbolBase (const TTSymbolBase &oldSymbol)
 Copy Constructor.
 
const char * getCString () const
 Return a pointer to the internal string as a C-string. More...
 
TTUInt32 getSymbolId () const
 Return this symbol's unique id. More...
 
TTUInt32 getSymbolTableId () const
 Return this symboltable's unique id. More...
 
 operator const char * () const
 Cast a symbol to a C-string. More...
 
 operator const TTString & () const
 Cast a symbol to a TTStringRef. More...
 

Protected Member Functions

void init (const TTString &newString, TTPtrSizedInt newSymbolTableId, TTInt32 newSymbolId)
 used by the constructors to create the new symbol
 

Friends

bool operator== (const TTSymbolBase &symbol1, const TTSymbolBase &symbol2)
 Compare two symbols for equality. More...
 
bool operator!= (const TTSymbolBase &symbol1, const TTSymbolBase &symbol2)
 Compare two symbols for inequality. More...
 

Detailed Description

The TTSymbolBase class is used to represent a string and efficiently pass and compare that string.

Note that generally speaking you should not directly create a TTSymbolBase! Instead, TTSymbolBase objects should only by created by the TTSymbolBaseTable that you are using. Because of this we always pass TTSymbolBases as references (#TTSymbolBaseRef) into the symbol table rather than as pointers or copies.

Also, if you don't need the fast lookup capabilities of the symbol table (such as for message or attribute lookup) then consider passing a TTString instead.

Definition at line 28 of file TTSymbolBase.h.

Constructor & Destructor Documentation

TTSymbolBase::TTSymbolBase ( const TTString newString,
TTPtrSizedInt  newSymbolTableId,
TTInt32  newSymbolId 
)

The constructor is intended only for use by the TTSymbolBaseTable object when creating new symbols in the table.

Perhaps this could be made private and then the class made a friend...

Definition at line 16 of file TTSymbolBase.cpp.

References init().

+ Here is the call graph for this function:

Member Function Documentation

const char* TTSymbolBase::getCString ( ) const
inline

Return a pointer to the internal string as a C-string.

Definition at line 55 of file TTSymbolBase.h.

References TTString::c_str().

Referenced by TTAddressBase::appendAddress(), TTSymbol::c_str(), TTAddressBase::countSeparator(), TTAddressBase::edit(), TTSymbol::operator const char *(), and TTAddressBase::splitAt().

+ Here is the call graph for this function:

TTUInt32 TTSymbolBase::getSymbolId ( ) const
inline

Return this symbol's unique id.

Definition at line 68 of file TTSymbolBase.h.

Referenced by TTSymbol::getSymbolId().

TTUInt32 TTSymbolBase::getSymbolTableId ( ) const
inline

Return this symboltable's unique id.

Definition at line 74 of file TTSymbolBase.h.

TTSymbolBase::operator const char * ( ) const
inline

Cast a symbol to a C-string.

Definition at line 102 of file TTSymbolBase.h.

References TTString::c_str().

+ Here is the call graph for this function:

TTSymbolBase::operator const TTString & ( ) const
inline

Cast a symbol to a TTStringRef.

Definition at line 109 of file TTSymbolBase.h.

Friends And Related Function Documentation

bool operator!= ( const TTSymbolBase symbol1,
const TTSymbolBase symbol2 
)
friend

Compare two symbols for inequality.

Definition at line 95 of file TTSymbolBase.h.

bool operator== ( const TTSymbolBase symbol1,
const TTSymbolBase symbol2 
)
friend

Compare two symbols for equality.

Definition at line 80 of file TTSymbolBase.h.


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