Base Module  VST 3.6.5
SDK for developing VST Plug-in
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Public Member Functions
TDictionary< TKey, TObject > Class Template Reference

Dictionary template definition. More...

#include <tdictionary.h>

+ Inheritance diagram for TDictionary< TKey, TObject >:

Public Member Functions

 TDictionary ()
 Default constructor. More...
 
 TDictionary (const TKey &errKey, const TObject &errObj)
 Constructor passing error values. More...
 
 TDictionary (const TDictionary< TKey, TObject > &)
 Copy constructor. More...
 
 ~TDictionary ()
 Destructor. More...
 
TDictionary< TKey, TObject > & operator= (const TDictionary< TKey, TObject > &)
 Assignment operator. More...
 
bool addKey (const TKey &)
 Add key. More...
 
bool addKeyAndObject (const TKey &, const TObject &)
 Add key/object. More...
 
bool addAssoc (const TAssociation< TKey, TObject > &)
 Add association. More...
 
bool replace (const TKey &, const TObject &)
 Replace object at key. More...
 
bool removeKey (const TKey &)
 Remove association at key. More...
 
const TKey & lookupKey (const TKey &) const
 Return equal key. More...
 
const TObject & lookupObject (const TKey &) const
 Return object by key. More...
 
bool containsKey (const TKey &) const
 Test if key is in dictionary. More...
 
int32 occurrencesOfKey (const TKey &) const
 How many equal keys. More...
 
const TAssociation< TKey,
TObject > & 
lookupAssoc (const TKey &) const
 Lookup association at key. More...
 
- Public Member Functions inherited from TDLinkedList< TAssociation< TKey, TObject > >
 TDLinkedList ()
 
 TDLinkedList (const TDLinkedList< TAssociation< TKey, TObject > > &)
 Copy constructor. More...
 
 TDLinkedList (const TContainer< TAssociation< TKey, TObject > > &)
 Initializes with copy of the given container. More...
 
 ~TDLinkedList ()
 
TDLinkedList< TAssociation
< TKey, TObject > > & 
operator= (const TDLinkedList< TAssociation< TKey, TObject > > &)
 
virtual TContainer
< TAssociation< TKey, TObject > > * 
newInstance () const
 
virtual bool add (const TAssociation< TKey, TObject > &item)
 Add item to end of list. More...
 
bool append (const TAssociation< TKey, TObject > &item)
 Same as TDLinkedList::add. More...
 
bool prepend (const TAssociation< TKey, TObject > &item)
 Add item to beginning of the list. More...
 
bool insertAt (int32 index, const TAssociation< TKey, TObject > &item)
 Insert item at the specified index. More...
 
bool replaceAt (int32 index, const TAssociation< TKey, TObject > &item)
 Replace item at the specified index. More...
 
virtual bool remove (const TAssociation< TKey, TObject > &item)
 
virtual bool remove (const TIterator< TAssociation< TKey, TObject > > &)
 (const TIterator<T>&) More...
 
virtual bool removeAt (int32 index)
 
virtual void removeAll ()
 
TAssociation< TKey, TObject > removeFirst ()
 
TAssociation< TKey, TObject > removeLast ()
 
bool insertAfter (const TAssociation< TKey, TObject > &after, const TAssociation< TKey, TObject > &item)
 
bool insertBefore (const TAssociation< TKey, TObject > &before, const TAssociation< TKey, TObject > &item)
 
TAssociation< TKey, TObject > & first () const
 
TAssociation< TKey, TObject > & last () const
 
int32 index (const TAssociation< TKey, TObject > &item) const
 Get index of equal item. More...
 
virtual TAssociation< TKey,
TObject > & 
at (int32 index) const
 
virtual TAssociation< TKey,
TObject > & 
lookup (const TAssociation< TKey, TObject > &item) const
 
virtual bool contains (const TAssociation< TKey, TObject > &item) const
 
virtual int32 occurrences (const TAssociation< TKey, TObject > &item) const
 
virtual TIterator
< TAssociation< TKey, TObject > > * 
newIterator () const
 
- Public Member Functions inherited from TContainer< TAssociation< TKey, TObject > >
 TContainer ()
 
 TContainer (const TContainer< TAssociation< TKey, TObject > > &)
 
virtual ~TContainer ()
 
bool operator== (const TContainer< TAssociation< TKey, TObject > > &) const
 
bool operator!= (const TContainer< TAssociation< TKey, TObject > > &) const
 
TAssociation< TKey, TObject > & operator[] (int32) const
 "[]" indexing operator returns the item at the specified index. More...
 
virtual int32 total () const
 Return number of items. More...
 
virtual bool isEmpty () const
 Is container empty? More...
 
virtual int32 size () const
 Returns the container size. More...
 
TContainer< TAssociation< TKey,
TObject > > * 
lookupAll (const TAssociation< TKey, TObject > &item) const
 Allocate and returns a container with all items in this container equal to the specified item. More...
 
bool addAllFrom (const TContainer< TAssociation< TKey, TObject > > &container)
 Adds all the items from the specified container to this container. More...
 
bool addNewFrom (const TContainer< TAssociation< TKey, TObject > > &container)
 Adds the items from the specified container to this container that are not in this container already. More...
 
TAssociation< TKey, TObject > & error () const
 Access error object. More...
 

Additional Inherited Members

- Protected Member Functions inherited from TContainer< TAssociation< TKey, TObject > >
void copy (const TContainer< TAssociation< TKey, TObject > > &container)
 Internal copy method. Copies the contents of the specified container into this container. More...
 
- Protected Attributes inherited from TContainer< TAssociation< TKey, TObject > >
TAssociation< TKey, TObject > errorObject
 Object used as return value when methods returning a T& fail. More...
 
int32 _size
 Container size. More...
 

Detailed Description

template<class TKey, class TObject>
class Steinberg::TDictionary< TKey, TObject >

Dictionary template definition.

A dictionary is a container that holds value pairs, a key and its associated value object. The container is sorted by key and thus allows for quick finding of a key and the lookup of the corresponding value.

Constructor & Destructor Documentation

TDictionary ( )
inline

Default constructor.

TDictionary ( const TKey &  errKey,
const TObject &  errObj 
)
inline

Constructor passing error values.

TDictionary ( const TDictionary< TKey, TObject > &  dict)

Copy constructor.

Creates a new dictionary and assigns it with a copy of the specified dictionary.

~TDictionary ( )
inline

Destructor.

Member Function Documentation

TDictionary< TKey, TObject > & operator= ( const TDictionary< TKey, TObject > &  dict)

Assignment operator.

Copies the dictionary specified on the right side of the operator into the dictionary on the left side.

bool addKey ( const TKey &  rKey)

Add key.

A new association between the specified key and a default constructed object value gets added.

bool addKeyAndObject ( const TKey &  rKey,
const TObject &  rObj 
)

Add key/object.

Adds a new association of specified key and object to the dicitonary.

bool addAssoc ( const TAssociation< TKey, TObject > &  rAssoc)

Add association.

Adds the specified association to the dictionary.

bool replace ( const TKey &  rKey,
const TObject &  rObj 
)

Replace object at key.

Finds the first occurrence of an association containing the specified key and replaces its value by the specified object value.

bool removeKey ( const TKey &  rKey)

Remove association at key.

Finds the first association at the specified key and removes it if found.

const TKey & lookupKey ( const TKey &  rKey) const

Return equal key.

Returns the key of the first occurrence of an association containing the specified key.

const TObject & lookupObject ( const TKey &  rKey) const

Return object by key.

Returns a copy of the object of the first occurrence of an association containing the specified key.

bool containsKey ( const TKey &  rKey) const

Test if key is in dictionary.

Returns true if the dictionary contains an association with the specified key.

int32 occurrencesOfKey ( const TKey &  rKey) const

How many equal keys.

Returns the number of associations containing the specified key.

const TAssociation< TKey, TObject > & lookupAssoc ( const TKey &  rKey) const

Lookup association at key.

Returns a copy of the first occurrence of an association containing the specified key.

Empty

Copyright ©2015 Steinberg Media Technologies GmbH. All Rights Reserved.