#include <d_Dictionary.h>
Inheritance diagram for d_Dictionary< K, V >:

Public Methods | |
| d_Dictionary () | |
| ~d_Dictionary () | |
| void | bind (const K &iKey, const V &iValue) |
| void | unbind (const K &iKey) |
| V | lookup (const K &iKey) |
| d_Boolean | contains_key (const K &iKey) |
| virtual d_Boolean | allows_duplicates () const |
| virtual d_Boolean | is_ordered () const |
| d_Iterator< d_Association< K, V > > | create_iterator () |
| d_Iterator< d_Association< K, V > > | begin () |
| d_Iterator< d_Association< K, V > > | end () |
| d_Dictionary (d_Object::DynaFactoryConstructor *iObj) | |
Public Attributes | |
| d_Iterator< d_Association< K, V > > | iter |
An association is compound of the couple key and value. Key and value can be of any types. It's like to the C++ STL map<> container, but the collection is transparently persistent.
This collection type is useful when items in the collection can be associated with keys. This collection offers methods to retrieve an item by a key.
LOCATION: d_Dictionary.h
USAGE: d_Dictionary< , <value-type> > <property-name>;
Where:
<key-type >: Key type. Can be a literal or a user type <value-type >: Value type. Can be a literal or a user type <PROPERTY-NAME>: NAME OF PROPERTY
<key-type> must be an ODMG literal or a user type but with the definition of operator<.
EXAMPLES: * DEFINITION OF A DICTIONARY OF CODE/PRODUCT d_Dictionary< d_String, d_Ref<Product> > Code_Products;
...
* INSERT A PRODUCT WITH ASSOCIATED ITS CODE
Code_Products.bind( "10345", product );
...
* LOOKUP OF A PRODUUCT BY CODE d_Ref<Product> product = Code_Products.lookup( "10345" );
SEE ALSO: d_Association, d_Collection, d_Iterator
ODMG: Compliant
|
|||||||||
|
Default Constructor. ODMG : Compliant |
|
|||||||||
|
Destructor. ODMG : Compliant |
|
||||||||||
|
|
|
|||||||||
|
Returns always false. ODMG : Compliant Implements d_Collection< d_Association< K, V > >. |
|
|||||||||
|
Returns an iterator that points to the first element. Permits to handle the container by STL classes. SEE ALSO: create_iterator() ODMG : Compliant |
|
||||||||||||||||
|
Insert a new association in the dictionary. Creates a new association between and and insert it in the dictionary. If an association with key is already present in the dictionary, the old value is replaced with the new value . |
|
||||||||||
|
Check if an association is present in the dictionary. Searches, in the dictionary, the association with key . If found returns true, otherwise false. SEE ALSO: lookup() ODMG : Compliant |
|
|||||||||
|
Returns an iterator that points to the first element. SEE ALSO: begin() ODMG : Compliant |
|
|||||||||
|
Returns an iterator that points to the last element. Permits to handle the container by STL classes. SEE ALSO: begin() ODMG : Compliant |
|
|||||||||
|
Returns always false. ODMG : Compliant Implements d_Collection< d_Association< K, V > >. |
|
||||||||||
|
Retrieve an association by key. Searches, in the dictionary, the association with key . If found returns the value of the association, otherwise a d_Error_ElementNotFound exception is thrown. SEE ALSO: contains_key() ODMG : Compliant |
|
||||||||||
|
Remove an association by the dictionary. If the dictionary contains an association with the key , it is removed from the dictionary. SEE ALSO: bind() ODMG : Compliant |
|
|||||
|
|
1.3-rc1