Jamoma API  0.6.0.a19
TTDictionary Class Reference

A type that represents the key as a C-String and the value as a pointer to the matching TTSymbol object. More...

#include <TTDictionary.h>

+ Collaboration diagram for TTDictionary:

Public Member Functions

 TTDictionary (TTSymbol aDictionaryName, TTBoolean &aDictionaryWasCreated)
 Constructor. More...
 
 TTDictionary (const TTDictionary &aSourceDictionary)
 Copy Constructor.
 
virtual ~TTDictionary ()
 Destructor.
 
TTSymbol name () const
 Return the name associated with the dictionary. More...
 
TTErr registerObserverForNotifications (const TTObjectBase &anObservingObject)
 Register an observer. More...
 
TTErr unregisterObserverForNotifications (const TTObjectBase &anObservingObject)
 Unregister an observer for notifications. More...
 
TTErr setSchema (const TTSymbol aSchemaName)
 TODO: Add documentation schemaName TODO: Add documentation. More...
 
const TTSymbol getSchema () const
 TODO: Add documentation. More...
 
TTErr setValue (const TTValue aNewValue)
 TODO: Add documentation. More...
 
template<class T >
TTErr getValue (T &aReturnedValue) const
 Get the dictionary's primary value. More...
 
TTErr append (const TTSymbol aKey, const TTValue aValue)
 Insert an item into the hash table. More...
 
TTErr lookup (const TTSymbol aKey, TTValue &aValue) const
 Find the value for the given key. More...
 
TTErr remove (const TTSymbol aKey)
 Remove an item from the hash table. More...
 
TTErr clear ()
 Remove all items from the hash table. More...
 
TTErr getKeys (TTValue &aSetOfKeys)
 Get an array of all of the keys for the hash table. More...
 
TTPtrSizedInt size ()
 Return the number of keys in the hash table. More...
 
TTBoolean empty ()
 Return true if the hash has nothing stored in it. More...
 

Detailed Description

A type that represents the key as a C-String and the value as a pointer to the matching TTSymbol object.

An iterator for the STL hash_map used by TTSymbolTable. Create and destroy Jamoma object instances.

Definition at line 47 of file TTDictionary.h.

Constructor & Destructor Documentation

TTDictionary::TTDictionary ( TTSymbol  aDictionaryName,
TTBoolean aDictionaryWasCreated 
)
inline

Constructor.

Parameters
aDictionaryNameThe symbolic name associated with this dictionary. If you pass an empty symbol then a random name with be generated and returned here.
aDictionaryWasCreatedUpon return this will be true if a new dictionary was created rather than an existing dictionary being referenced.

Definition at line 62 of file TTDictionary.h.

Member Function Documentation

TTErr TTDictionary::append ( const TTSymbol  aKey,
const TTValue  aValue 
)
inline

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 212 of file TTDictionary.h.

References TTDictionaryBase::append().

+ Here is the call graph for this function:

TTErr TTDictionary::clear ( )
inline

Remove all items from the hash table.

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

Definition at line 240 of file TTDictionary.h.

References TTDictionaryBase::clear().

+ Here is the call graph for this function:

TTBoolean TTDictionary::empty ( )
inline

Return true if the hash has nothing stored in it.

Returns
TRUE if the hash has nothing stored in it.

Definition at line 268 of file TTDictionary.h.

References TTDictionaryBase::isEmpty().

+ Here is the call graph for this function:

TTErr TTDictionary::getKeys ( TTValue aSetOfKeys)
inline

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 250 of file TTDictionary.h.

References TTDictionaryBase::getKeys().

+ Here is the call graph for this function:

const TTSymbol TTDictionary::getSchema ( ) const
inline

TODO: Add documentation.

Returns
TODO: Add documentation

Definition at line 181 of file TTDictionary.h.

References TTDictionaryBase::getSchema().

Referenced by TTAdsr::dictionary().

+ Here is the call graph for this function:

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

Get the dictionary's primary value.

Parameters
nameThe name of the attribute to get.
valueThe returned value of the attribute.
Returns
TTErr error code if the method fails to execute, else kTTErrNone.

Definition at line 202 of file TTDictionary.h.

References TTDictionaryBase::getValue().

Referenced by TTAudioGraphSig::dictionary(), TTAdsr::dictionary(), and TTDictionaryBase::getValue().

+ Here is the call graph for this function:

TTErr TTDictionary::lookup ( const TTSymbol  aKey,
TTValue aValue 
) const
inline

Find the value for the given key.

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

Definition at line 221 of file TTDictionary.h.

References TTDictionaryBase::lookup().

+ Here is the call graph for this function:

TTSymbol TTDictionary::name ( ) const
inline

Return the name associated with the dictionary.

Definition at line 131 of file TTDictionary.h.

TTErr TTDictionary::registerObserverForNotifications ( const TTObjectBase anObservingObject)

Register an observer.

The observer will be monitoring this object.

Parameters
anObservingObjectReference to the observing object.
Returns
TTErr error code if the method fails to execute, else kTTErrNone.

Definition at line 25 of file TTDictionary.cpp.

TTErr TTDictionary::remove ( const TTSymbol  aKey)
inline

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 231 of file TTDictionary.h.

References TTDictionaryBase::remove().

+ Here is the call graph for this function:

TTErr TTDictionary::setSchema ( const TTSymbol  aSchemaName)
inline

TODO: Add documentation schemaName TODO: Add documentation.

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

Definition at line 172 of file TTDictionary.h.

References TTDictionaryBase::setSchema().

Referenced by PackNew().

+ Here is the call graph for this function:

TTErr TTDictionary::setValue ( const TTValue  aNewValue)
inline

TODO: Add documentation.

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

Definition at line 191 of file TTDictionary.h.

References TTDictionaryBase::setValue().

+ Here is the call graph for this function:

TTPtrSizedInt TTDictionary::size ( )
inline

Return the number of keys in the hash table.

Returns
The number of keys in the hash table.

Definition at line 259 of file TTDictionary.h.

References TTDictionaryBase::getSize().

+ Here is the call graph for this function:

TTErr TTDictionary::unregisterObserverForNotifications ( const TTObjectBase anObservingObject)

Unregister an observer for notifications.

The observer wiln no longer be monitoring.

Parameters
anObservingObjectReference to the observing object.
Returns
TTErr error code if the method fails to execute, else kTTErrNone.

Definition at line 36 of file TTDictionary.cpp.


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