Jamoma API  0.6.0.a19
TTSymbol Class Reference

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

#include <TTSymbol.h>

+ Inheritance diagram for TTSymbol:
+ Collaboration diagram for TTSymbol:

Public Member Functions

const char * c_str () const
 Return a pointer to the internal string as a C-string. More...
 
TTUInt32 getSymbolId () const
 Return this symbol'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...
 
TTPtr rawpointer () const
 Get the value of the raw pointer into the symbol table. More...
 

Static Public Member Functions

static TTSymbol random ()
 Generate a pseudo-random symbol.
 

Protected Attributes

TTSymbolBasemSymbolPointer
 pointer to the symbol that we represent
 

Friends

bool operator== (const TTSymbol &symbol1, const TTSymbol &symbol2)
 Compare two symbols for equality. More...
 
bool operator!= (const TTSymbol &symbol1, const TTSymbol &symbol2)
 Compare two symbols for inequality. More...
 
bool operator== (const TTSymbol &symbol1, const char *aCString)
 Compare a symbols against a c-string for equality. More...
 

Detailed Description

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

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 to keep the internal symbol table from becoming bloated.

Definition at line 26 of file TTSymbol.h.

Member Function Documentation

const char* TTSymbol::c_str ( ) const
inline

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

Definition at line 77 of file TTSymbol.h.

References TTSymbolBase::getCString().

Referenced by TTClass::createInstance(), TTAddressBase::edit(), filter_gettypes(), TTNode::getAddress(), TTAddressBase::getNameInstance(), TTXmlHandler::getXmlAttribute(), jamoma_callback_return_address(), jamoma_edit_filename(), jamoma_patcher_get_info(), jamoma_subscriber_create(), jamoma_TTName_To_MaxName(), jamoma_TTName_To_PdName(), jamoma_ttvalue_to_Atom(), jamoma_ttvalue_to_typed_Atom(), TTObjectBase::logDebug(), TTObjectBase::logError(), TTObjectBase::logMessage(), TTObjectBase::logWarning(), TTNodeDirectory::Lookup(), model_preset_dowrite(), model_preset_edit(), model_reference_dowrite(), model_subscribe(), OSCReceiveMessageCallback(), TTXmlHandler::Read(), receive_address(), receive_subscribe(), TTEnvironment::registerClass(), TTObjectBase::registerMessage(), score_doread(), score_dowrite(), send_address(), send_return_model_address(), send_subscribe(), TTWebSocket::SendMessage(), TTSoundfilePlayer::setFilePath(), TTSoundfile::setFilePath(), TTNode::setNameInstance(), TTSoundfile::test(), TTContainerValueAttributeCallback(), TTObject::TTObject(), wrapAsMaxAudioGraph(), WrappedReceiverClass_new(), WrappedSenderClass_new(), wrapTTModularClassAsMaxClass(), wrapTTModularClassAsPdClass(), and TTXmlHandler::Write().

+ Here is the call graph for this function:

TTUInt32 TTSymbol::getSymbolId ( ) const
inline

Return this symbol's unique id.

Definition at line 90 of file TTSymbol.h.

References TTSymbolBase::getSymbolId().

+ Here is the call graph for this function:

TTSymbol::operator const char * ( ) const
inline

Cast a symbol to a C-string.

Definition at line 118 of file TTSymbol.h.

References TTSymbolBase::getCString().

+ Here is the call graph for this function:

TTSymbol::operator const TTString & ( ) const
inline

Cast a symbol to a TTStringRef.

Definition at line 125 of file TTSymbol.h.

TTPtr TTSymbol::rawpointer ( ) const
inline

Get the value of the raw pointer into the symbol table.

Do not use this unless you absolutely know what you are doing.

Definition at line 134 of file TTSymbol.h.

Referenced by TTHash::append(), TTDictionaryBase::append(), TTHash::lookup(), TTDictionaryBase::lookup(), TTHash::remove(), TTDictionaryBase::remove(), wrapTTModularClassAsMaxClass(), wrapTTModularClassAsPdClass(), and TTDictionary::~TTDictionary().

Friends And Related Function Documentation

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

Compare two symbols for inequality.

Definition at line 104 of file TTSymbol.h.

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

Compare two symbols for equality.

Definition at line 97 of file TTSymbol.h.

bool operator== ( const TTSymbol symbol1,
const char *  aCString 
)
friend

Compare a symbols against a c-string for equality.

Definition at line 111 of file TTSymbol.h.


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