Jamoma API  0.6.0.a19
TTDictionaryBase Class Reference

A type that contains a key and a value. More...

#include <TTDictionaryBase.h>

Public Member Functions

TTErr setSchema (const TTSymbol schemaName)
 TODO: Add documentation schemaName TODO: Add documentation. More...
 
const TTSymbol getSchema () const
 TODO: Add documentation. More...
 
TTErr setValue (const TTValue &newValue)
 TODO: Add documentation. More...
 
TTErr getValue (TTValue &returnedValue) const
 TODO: Add documentation. More...
 
template<class T >
TTErr getValue (T &aReturnedValue) const
 Get a dictionary's primary value. More...
 
TTErr append (const TTSymbol key, const TTValue &value)
 Insert an item into the hash table. More...
 
TTErr lookup (const TTSymbol key, TTValue &value) const
 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 getKeys (TTValue &hashKeys)
 Get an array of all of the keys 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...
 

Friends

class TTDictionary
 

Detailed Description

A type that contains a key and a value.

The dictionary is a data structure that combines the fast lookup of a hashtable, but may be sorted like a linked-list. This accomplished internally by maintaining the two data structures in parallel.

Note that generally speaking you should not directly create a TTDictionaryBase! Instead, TTDictionaryBase objects should only by created by the instantiating a TTDictionary.

Definition at line 55 of file TTDictionaryBase.h.

Member Function Documentation

TTErr TTDictionaryBase::append ( const TTSymbol  key,
const TTValue value 
)

Insert an item into the hash table.

Parameters
valueThe value to instert.
Returns
TTErr error code if the method fails to execute, else kTTErrNone.

Definition at line 77 of file TTDictionaryBase.cpp.

References kTTErrNone, and TTSymbol::rawpointer().

Referenced by TTDictionary::append(), jamoma_explorer_default_filter_bank(), setSchema(), setValue(), TTDataParseCommand(), and TTMapperReceiveValueCallback().

+ Here is the call graph for this function:

TTErr TTDictionaryBase::clear ( )

Remove all items from the hash table.

Returns
TTErr error code if the method fails to execute, else kTTErrNone.

Definition at line 137 of file TTDictionaryBase.cpp.

References kTTErrNone.

Referenced by TTDictionary::clear().

TTErr TTDictionaryBase::getKeys ( TTValue hashKeys)

Get an array of all of the keys for the hash table.

Parameters
hashKeysUsed to return an array of all of the keys for the hash table
Returns
TTErr error code if the method fails to execute, else kTTErrNone.

Definition at line 146 of file TTDictionaryBase.cpp.

References TTValue::append(), TTValue::clear(), and kTTErrNone.

Referenced by TTDictionary::getKeys().

+ Here is the call graph for this function:

const TTSymbol TTDictionaryBase::getSchema ( ) const

TODO: Add documentation.

Returns
TODO: Add documentation

Definition at line 56 of file TTDictionaryBase.cpp.

References lookup().

Referenced by TTDictionary::getSchema().

+ Here is the call graph for this function:

TTUInt32 TTDictionaryBase::getSize ( )

Return the number of keys in the hash table.

Returns
The number of keys in the hash table.

Definition at line 163 of file TTDictionaryBase.cpp.

Referenced by TTDictionary::size().

TTErr TTDictionaryBase::getValue ( TTValue returnedValue) const

TODO: Add documentation.

Parameters
returnedValueTODO: Add documentation
Returns
TTErr error code if the method fails to execute, else kTTErrNone.

Definition at line 71 of file TTDictionaryBase.cpp.

References lookup().

Referenced by TTDictionary::getValue().

+ Here is the call graph for this function:

template<class T >
TTErr TTDictionaryBase::getValue ( T &  aReturnedValue) const
inline

Get a dictionary's primary value.

Parameters
valueThe returned value of the dictionary.
Returns
TTErr error code if the method fails to execute, else kTTErrNone.

Definition at line 118 of file TTDictionaryBase.h.

References TTDictionary::getValue().

+ Here is the call graph for this function:

TTBoolean TTDictionaryBase::isEmpty ( )

Return true if the hash has nothing stored in it.

Returns
TRUE if the hash has nothing stored in it.

Definition at line 169 of file TTDictionaryBase.cpp.

Referenced by TTDictionary::empty().

TTErr TTDictionaryBase::lookup ( const TTSymbol  key,
TTValue value 
) const

Find the value for the given key.

Returns
TTErr error code if the method fails to execute, else kTTErrNone.

Definition at line 95 of file TTDictionaryBase.cpp.

References kTTErrNone, kTTErrValueNotFound, and TTSymbol::rawpointer().

Referenced by getSchema(), getValue(), and TTDictionary::lookup().

+ Here is the call graph for this function:

TTErr TTDictionaryBase::remove ( const TTSymbol  key)

Remove an item from the hash table.

Parameters
keyThe key of the item to remove.
Returns
TTErr error code if the method fails to execute, else kTTErrNone.

Definition at line 121 of file TTDictionaryBase.cpp.

References kTTErrNone, and TTSymbol::rawpointer().

Referenced by TTDictionary::remove().

+ Here is the call graph for this function:

TTErr TTDictionaryBase::setSchema ( const TTSymbol  schemaName)

TODO: Add documentation schemaName TODO: Add documentation.

Returns
TTErr error code if the method fails to execute, else kTTErrNone.

Definition at line 50 of file TTDictionaryBase.cpp.

References append().

Referenced by jamoma_explorer_default_filter_bank(), TTDictionary::setSchema(), TTDataParseCommand(), and TTMapperReceiveValueCallback().

+ Here is the call graph for this function:

TTErr TTDictionaryBase::setValue ( const TTValue newValue)

TODO: Add documentation.

Parameters
newValueTODO: Add documentation
Returns
TTErr error code if the method fails to execute, else kTTErrNone.

Definition at line 65 of file TTDictionaryBase.cpp.

References append().

Referenced by TTDictionary::setValue(), TTDataParseCommand(), and TTMapperReceiveValueCallback().

+ Here is the call graph for this function:


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