openDAQ
Open data acquisition platform
IDict Struct Referenceabstract

Represents a collection of key/value pairs. More...

+ Inheritance diagram for IDict:
+ Collaboration diagram for IDict:

Detailed Description

Represents a collection of key/value pairs.

Public Member Functions

virtual ErrCode INTERFACE_FUNC get (IBaseObject *key, IBaseObject **value)=0
 Gets the element with the specified key. More...
 
virtual ErrCode INTERFACE_FUNC set (IBaseObject *key, IBaseObject *value)=0
 Sets the element with the specified key. More...
 
virtual ErrCode INTERFACE_FUNC remove (IBaseObject *key, IBaseObject **value)=0
 Removes the element with the specified key. More...
 
virtual ErrCode INTERFACE_FUNC deleteItem (IBaseObject *key)=0
 Deletes the element with the specified key. More...
 
virtual ErrCode INTERFACE_FUNC clear ()=0
 Removes all elements from the list.
 
virtual ErrCode INTERFACE_FUNC getCount (SizeT *size)=0
 Gets the number of elements contained in the dictionary. More...
 
virtual ErrCode INTERFACE_FUNC hasKey (IBaseObject *key, Bool *hasKey)=0
 Checks if the element with the specified key exists in the dictionary. More...
 
virtual ErrCode INTERFACE_FUNC getKeyList (IList **keys)=0
 Gets the list of all keys in the dictionary. More...
 
virtual ErrCode INTERFACE_FUNC getValueList (IList **values)=0
 Gets the list of all elements in the dictionary. More...
 
virtual ErrCode INTERFACE_FUNC getKeys (IIterable **iterable)=0
 Gets the iterable interface of the keys. More...
 
virtual ErrCode INTERFACE_FUNC getValues (IIterable **iterable)=0
 Gets the iterable interface of the elements. More...
 
- Public Member Functions inherited from IBaseObject
virtual ErrCode INTERFACE_FUNC borrowInterface (const IntfID &intfID, void **obj) const =0
 Returns another interface which is supported by the object without incrementing the reference count. More...
 
virtual ErrCode INTERFACE_FUNC dispose ()=0
 Disposes all references held by the object. More...
 
virtual ErrCode INTERFACE_FUNC getHashCode (SizeT *hashCode)=0
 Returns hash code of the object. More...
 
virtual ErrCode INTERFACE_FUNC equals (IBaseObject *other, Bool *equal) const =0
 Compares object to another object for equality. More...
 
virtual ErrCode INTERFACE_FUNC toString (CharPtr *str)=0
 Returns a string representation of the object. More...
 
- Public Member Functions inherited from IUnknown
virtual ErrCode INTERFACE_FUNC queryInterface (const IntfID &intfID, void **obj)=0
 Returns another interface which is supported by the object and increments the reference count. More...
 
virtual int INTERFACE_FUNC addRef ()=0
 Increments the reference count for an interface on an object. More...
 
virtual int INTERFACE_FUNC releaseRef ()=0
 Decrements the reference count for an interface on an object. More...
 

Member Function Documentation

◆ deleteItem()

virtual ErrCode INTERFACE_FUNC deleteItem ( IBaseObject key)
pure virtual

Deletes the element with the specified key.

Parameters
keyThe key of the element to delete.

If the client needs the element deleted, it should use removeAt method.

◆ get()

virtual ErrCode INTERFACE_FUNC get ( IBaseObject key,
IBaseObject **  value 
)
pure virtual

Gets the element with the specified key.

Parameters
keyThe key of the element to get.
[out]valueThe element with the specified key.

The reference count of the element that is retrieved is incremented. The client is responsible for calling releaseRef when the element is no longer needed.

◆ getCount()

virtual ErrCode INTERFACE_FUNC getCount ( SizeT *  size)
pure virtual

Gets the number of elements contained in the dictionary.

Parameters
[out]sizeThe number of elements contained in the dictionary.

◆ getKeyList()

virtual ErrCode INTERFACE_FUNC getKeyList ( IList **  keys)
pure virtual

Gets the list of all keys in the dictionary.

Parameters
[out]keysThe list of the keys.

The order of the keys is not defined.

The client is responsible for calling releaseRef when the list is no longer needed.

◆ getKeys()

virtual ErrCode INTERFACE_FUNC getKeys ( IIterable **  iterable)
pure virtual

Gets the iterable interface of the keys.

Parameters
[out]iterableThe iterable interface of the keys.

The Iterable interface enables iteration through the keys.

The client is responsible for calling releaseRef when the interface is no longer needed.

◆ getValueList()

virtual ErrCode INTERFACE_FUNC getValueList ( IList **  values)
pure virtual

Gets the list of all elements in the dictionary.

Parameters
[out]valuesThe list of the elements.

The order of the elements is not defined.

The client is responsible for calling releaseRef when the list is no longer needed.

◆ getValues()

virtual ErrCode INTERFACE_FUNC getValues ( IIterable **  iterable)
pure virtual

Gets the iterable interface of the elements.

Parameters
[out]iterableThe iterable interface of the elements.

The Iterable interface enables iteration through the elements.

The client is responsible for calling releaseRef when the interface is no longer needed.

◆ hasKey()

virtual ErrCode INTERFACE_FUNC hasKey ( IBaseObject key,
Bool *  hasKey 
)
pure virtual

Checks if the element with the specified key exists in the dictionary.

Parameters
keyThe key of the element to check.
[out]hasKeyTrue if the element exists, False otherwise.

◆ remove()

virtual ErrCode INTERFACE_FUNC remove ( IBaseObject key,
IBaseObject **  value 
)
pure virtual

Removes the element with the specified key.

Parameters
keyThe key of the element to remove.
[out]valueThe element with the specified key.

The client is responsible for calling releaseRef when the element is no longer needed. If the client does not need the element after it is removed, it should call delete method.

◆ set()

virtual ErrCode INTERFACE_FUNC set ( IBaseObject key,
IBaseObject value 
)
pure virtual

Sets the element with the specified key.

Parameters
keyThe key of the element to set.
valueThe element with the specified key.

The reference count of the key and the element is incremented.