Jamoma API
0.6.0.a19
|
The TTSymbolBase class is used to represent a string and efficiently pass and compare that string. More...
#include <TTSymbolBase.h>
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... | |
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.
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().
|
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().
|
inline |
Return this symbol's unique id.
Definition at line 68 of file TTSymbolBase.h.
Referenced by TTSymbol::getSymbolId().
|
inline |
Return this symboltable's unique id.
Definition at line 74 of file TTSymbolBase.h.
|
inline |
Cast a symbol to a C-string.
Definition at line 102 of file TTSymbolBase.h.
References TTString::c_str().
|
inline |
Cast a symbol to a TTStringRef.
Definition at line 109 of file TTSymbolBase.h.
|
friend |
Compare two symbols for inequality.
Definition at line 95 of file TTSymbolBase.h.
|
friend |
Compare two symbols for equality.
Definition at line 80 of file TTSymbolBase.h.