Jamoma API
0.6.0.a19
|
Maintain a collection of TTValue objects indexed by TTSymbol pointers. More...
#include <TTHash.h>
Public Member Functions | |
TTErr | append (const TTSymbol key, const TTValue &value) |
Insert an item into the hash table. More... | |
TTErr | lookup (const TTSymbol key, TTValue &value) |
Find the value for the given key. More... | |
TTErr | remove (const TTSymbol key) |
Remove an item from the hash table. More... | |
TTErr | clear () |
Remove all items from the hash table. More... | |
TTErr | iterate (const TTPtr target, const TTHashIteratorType callback) |
For each item in the hash, run specified function. More... | |
TTErr | getKeys (TTValue &hashKeys) |
Get an array of all of the keys for the hash table. More... | |
TTErr | getKeysSorted (TTValue &hashKeysSorted, TTBoolean(*comparisonFunction)(TTValue &, TTValue &)=NULL) |
Get an array of all of the keys sorted for the hash table. More... | |
TTUInt32 | getSize () |
Return the number of keys in the hash table. More... | |
TTBoolean | isEmpty () |
Return true if the hash has nothing stored in it. More... | |
Maintain a collection of TTValue objects indexed by TTSymbol pointers.
The TTValue objects can themselves include TTSymbol pointers, TTObjects, simple values, polymorphic arrays, etc.
TTHash is implemented as a light wrapper class around the STL hash_map templates. While we could inherit from hash_map and then override the appropriate things, there are a few reasons to just contain the hash_map and wrap it.
Insert an item into the hash table.
Definition at line 70 of file TTHash.cpp.
References TTSymbol::rawpointer().
Referenced by TTNodeDirectory::addObserverForNotifications(), TTNodeDirectory::AliasCreate(), MaxAudioGraphWrappedClassOptions::append(), TTProtocol::ApplicationRegister(), TTProtocol::ApplicationRename(), TTObjectBase::extendAttribute(), jamoma_explorer_default_filter_bank(), TTObjectBase::registerAttribute(), TTEnvironment::registerClass(), TTObjectBase::registerMessage(), TTDataspace::registerUnit(), TTProtocol::setApplicationParameters(), TTNode::setChild(), TTNode::setNameInstance(), TTApplicationManagerAddApplicationObserver(), TTExplorerDirectoryCallback(), TTModularSelectionLookup(), and TTNodeDirectory::TTNodeCreate().
TTErr TTHash::clear | ( | ) |
Remove all items from the hash table.
Definition at line 117 of file TTHash.cpp.
References kTTErrNone.
Referenced by TTNode::getChildrenInstance(), TTNodeDirectory::init(), TTExplorerDirectoryCallback(), and TTNode::~TTNode().
Get an array of all of the keys for the hash table.
Definition at line 126 of file TTHash.cpp.
References TTValue::append(), TTValue::clear(), and kTTErrNone.
Referenced by TTNodeDirectory::getAlias(), TTEnvironment::getAllClassNames(), TTProtocol::getApplicationNames(), TTApplicationManager::getApplicationProtocolNames(), TTObjectBase::getAttributeNames(), TTDataspace::getAvailableUnits(), TTNode::getChildren(), TTNode::getChildrenInstance(), TTNode::getChildrenName(), TTObjectBase::getMessageNames(), TTNodeDirectory::notifyObservers(), TTNodeDirectory::replaceAlias(), TTNode::setNameInstance(), wrappedModularClass_anything(), wrappedModularClass_attrSet(), TTNode::~TTNode(), TTObjectBase::~TTObjectBase(), and TTProtocol::~TTProtocol().
TTErr TTHash::getKeysSorted | ( | TTValue & | hashKeysSorted, |
TTBoolean(*)(TTValue &, TTValue &) | comparisonFunction = NULL |
||
) |
Get an array of all of the keys sorted for the hash table.
Definition at line 148 of file TTHash.cpp.
References TTValue::append(), TTValue::clear(), and kTTErrNone.
TTUInt32 TTHash::getSize | ( | ) |
Return the number of keys in the hash table.
Definition at line 199 of file TTHash.cpp.
Referenced by TTNode::getChildren(), TTNode::getChildrenInstance(), TTNode::getChildrenName(), TTObjectBase::registerMessage(), TTNode::setNameInstance(), and TTNode::~TTNode().
TTBoolean TTHash::isEmpty | ( | ) |
Return true if the hash has nothing stored in it.
Definition at line 205 of file TTHash.cpp.
Referenced by TTNodeDirectory::notifyObservers(), wrappedModularClass_anything(), and wrappedModularClass_attrSet().
For each item in the hash, run specified function.
Definition at line 188 of file TTHash.cpp.
References kTTErrNone.
Find the value for the given key.
Definition at line 76 of file TTHash.cpp.
References TTSymbol::rawpointer().
Referenced by TTNodeDirectory::addObserverForNotifications(), TTProtocol::ApplicationRegister(), TTProtocol::ApplicationRename(), TTProtocol::ApplicationUnregister(), TTApplication::convertAppNameToTTName(), TTApplication::convertTTNameToAppName(), TTEnvironment::createInstance(), TTApplicationManager::findApplication(), TTObjectBase::findAttribute(), TTObjectBase::findMessage(), TTApplicationManager::findProtocol(), TTNode::generateInstance(), TTNodeDirectory::getAlias(), TTProtocol::getApplicationParameters(), TTApplicationManager::getApplicationProtocolNames(), TTNode::getChildren(), TTNode::getChildrenInstance(), TTEnvironment::getClassNamesWithTags(), getSelectedObject(), TTEnvironment::isClassRegistered(), TTProtocol::isRegistered(), MaxAudioGraphWrappedClassOptions::lookup(), model_preset_doedit(), model_preset_doread(), model_preset_doread_again(), model_preset_dowrite(), model_preset_dowrite_again(), model_preset_edit(), model_reference_dowrite(), model_signal_amenities(), model_signal_return_audio_bypass(), model_signal_return_audio_gain(), model_signal_return_audio_mix(), model_signal_return_audio_mute(), model_signal_return_data_active(), model_signal_return_data_bypass(), TTNodeDirectory::notifyObservers(), receive_address(), TTObjectBase::registerAttributeProperty(), TTEnvironment::registerClass(), TTObjectBase::registerMessageProperty(), TTNodeDirectory::removeObserverForNotifications(), TTNodeDirectory::replaceAlias(), send_address(), TTProtocol::setApplicationParameters(), TTNode::setChild(), TTDataspace::setInputUnit(), TTNode::setNameInstance(), TTDataspace::setOutputUnit(), TTNode::setParent(), TTApplicationManagerAddApplicationObserver(), TTApplicationManagerRemoveApplicationObserver(), TTModularSelectionLookup(), TTNodeDirectory::TTNodeCreate(), TTNode::~TTNode(), TTObjectBase::~TTObjectBase(), and TTProtocol::~TTProtocol().
Remove an item from the hash table.
Definition at line 108 of file TTHash.cpp.
References kTTErrNone, and TTSymbol::rawpointer().
Referenced by TTNodeDirectory::AliasRemove(), TTProtocol::ApplicationRename(), TTProtocol::ApplicationUnregister(), receive_address(), TTObjectBase::removeAttribute(), TTObjectBase::removeMessage(), TTNodeDirectory::removeObserverForNotifications(), send_address(), TTProtocol::setApplicationParameters(), TTNode::setNameInstance(), TTApplicationManagerRemoveApplicationObserver(), TTExplorerDirectoryCallback(), TTNodeDirectory::TTNodeRemove(), and TTNode::~TTNode().