Dictionary Object Library

A dictionary object is a collection of key-value pairs.

Each pair is considered an entry or a 'named value', where the key acts as the name of the entry. Keys are unique - you can't add an entry with a duplicate key.

A dictionary object is a collection of key-value pairs. Each pair is considered an entry or a 'named value', where the key acts as the name of the entry. Keys are unique - you can't add an entry with a duplicate key.

Both the keys and values are represented by shareable string objects. A shareable string is a data structure that encapsulates a string so that it can't be modified directly. This design allows multiple threads to read the string without the risk that the string will be changed inadvertently between reads. Modifying a shareable string creates a new string and destroys the original.

The dictionary object API allows the creation of multiple handles to a dictionary object that can be used and destroyed by independent components of a program. Since a dictionary, once created, is immutable until destroyed, components can access it through their handles without worrying about synchronization.

Different dictionary object handles may be represented by identical pointers. You should not compare handles. Regardless of how the handles are represented internally, you must destroy each handle separately to properly dispose of any resources associated with it.

Dictionary objects are often used when working with mm-renderer. For example, you can use the dictionary API to define settings for an mm-renderer context, input, and output parameters, ahead of calling the API functions that set those parameters.

The dictionary object API header file, strm.h, can be found in the folder /usr/include/sys.

Since:
BlackBerry 10.0.0

Last modified: 2014-09-30



Got questions about leaving a comment? Get answers from our Disqus FAQ.

comments powered by Disqus