|
openDAQ
Open data acquisition platform
|
Represents a collection of key/value pairs. More...
Inheritance diagram for DictObjectPtr< T, KeyT, ValueT, KeyPtr, ValuePtr >:
Collaboration diagram for DictObjectPtr< T, KeyT, ValueT, KeyPtr, ValuePtr >:Represents a collection of key/value pairs.
Public Member Functions | |
| ValuePtr | get (const KeyPtr &key) const |
| Gets the element with the specified key. More... | |
| ValuePtr | getOrDefault (const KeyPtr &key, const ValuePtr &defaultValue=nullptr) const |
| Gets the element with the specified key. More... | |
| bool | tryGet (const KeyPtr &key, ValuePtr &value) const |
| Gets the element with the specified key. More... | |
| void | set (const KeyPtr &key, const ValuePtr &value) |
| Sets the element with the specified key. More... | |
| ValuePtr | remove (const KeyPtr &key) |
| Removes the element with the specified key. More... | |
| bool | tryRemove (const KeyPtr &key) |
| Removes the element with the specified key. More... | |
| void | deleteItem (const KeyPtr &key) |
| Deletes the element with the specified key. More... | |
| SizeT | getCount () const |
| Gets the number of elements contained in the dictionary. More... | |
| void | clear () |
| Removes all elements from the list. | |
| bool | hasKey (const KeyPtr &key) const |
| Checks if the element with the specified key exists in the dictionary. More... | |
| ListPtr< KeyT, KeyPtr > | getKeyList () const |
| Gets the list of all keys in the dictionary. More... | |
| ListPtr< ValueT, ValuePtr > | getValueList () const |
| Gets the list of all elements in the dictionary. More... | |
| IterablePtr< KeyT, KeyPtr > | getKeys () const |
| Gets the iterable interface of the keys. More... | |
| IterablePtr< ValueT, ValuePtr > | getValues () const |
| Gets the iterable interface of the elements. More... | |
| IntfID | getKeyInterfaceId () const |
| Returns the interface id of the expected key type. More... | |
| IntfID | getValueInterfaceId () const |
| Returns the interface id of the expected value type. More... | |
| IteratorType | begin () const |
| Creates start iterator for the dictionary. | |
| IteratorType | end () const |
| Creates end iterator for the dictionary. | |
Public Member Functions inherited from ObjectPtr< T > | |
| ObjectPtr () | |
| Creates a smart pointer with no wrapped interface. | |
| ObjectPtr (std::nullptr_t) | |
| Creates a smart pointer with no wrapped interface. | |
| ObjectPtr (const ObjectPtr< T > &objPtr) | |
| Creates a smart pointer from another smart pointer. More... | |
| ObjectPtr (ObjectPtr< T > &&objPtr) noexcept | |
| Creates a smart pointer from another smart pointer with move semantics. More... | |
| template<class U > | |
| ObjectPtr (const ObjectPtr< U > &objPtr) | |
| Creates a smart pointer from another smart pointer of a different interface type. More... | |
| template<class U > | |
| ObjectPtr (ObjectPtr< U > &&objPtr) | |
| Creates a smart pointer from another smart pointer of a different interface type with move semantics. More... | |
| ObjectPtr (T *&obj) | |
| Creates a smart pointer from an interface pointer. More... | |
| ObjectPtr (T *&&obj) | |
| Creates a smart pointer from an interface pointer with move semantics. More... | |
| ObjectPtr (IWeakRef *obj) | |
| Creates a smart pointer from a weak reference interface pointer. More... | |
| ObjectPtr (const wchar_t *value) | |
| Creates a string object smart pointer from UTF16 null terminated sequence. More... | |
| ObjectPtr (ConstCharPtr value) | |
| Creates a string object smart pointer from UTF8 null terminated sequence. More... | |
| template<typename U , std::enable_if_t< is_ct_conv< U >::value &&!std::is_enum_v< U >, int > = 0> | |
| ObjectPtr (const U &value) | |
| Creates a smart pointer wrapper from value type. More... | |
| virtual | ~ObjectPtr () |
| Destructor. More... | |
| bool | equals (ObjectPtr< IBaseObject > other) const |
| Compares object to another object for equality. More... | |
| T * | detach () |
| Disassociates this smart pointer object from the interface that it represents. More... | |
| void | dispose () const |
| Disposes all references held by the object. More... | |
| void | release () |
| Resets the wrapped interface to nullptr. More... | |
| T * | addRefAndReturn () const |
| Increments the reference count and returns the interface. More... | |
| operator T* () const | |
| Casts the pointer to the wrapped interface. More... | |
| bool | assigned () const |
| Checks if the smart pointer is not empty. | |
| T * | getObject () const |
| Gets the pointer to the wrapped interface. More... | |
| T ** | addressOf () |
| Gets the address of the pointer to the wrapped interface. More... | |
| T ** | operator& () |
| Gets the address of the pointer to the wrapped interface. More... | |
| template<class U > | |
| U * | as (bool borrow=false) const |
| Casts the wrapped interface to another interface. More... | |
| template<class U > | |
| U * | asOrNull (bool borrow=false) const |
| Casts the wrapped interface to another interface. More... | |
| template<class U , class Ptr = typename InterfaceToSmartPtr<U>::SmartPtr> | |
| Ptr | asPtr (bool borrow=false) const |
| Casts the wrapped interface to another interface and wraps in a smart pointer. More... | |
| template<class U , class Ptr = typename InterfaceToSmartPtr<U>::SmartPtr> | |
| Ptr | asPtrOrNull (bool borrow=false) const |
| Casts the wrapped interface to another interface and wraps in a smart pointer. More... | |
| template<class U > | |
| bool | supportsInterface () const |
| Checks if the wrapped interface supports another interface. More... | |
| bool | supportsInterface (const IntfID &id) const |
| Checks if the wrapped interface supports another interface using the interface ID. More... | |
| CoreType | getCoreType () const |
Gets the object's CoreType. More... | |
| ObjectPtr< IBaseObject > | convertTo (CoreType ct) const |
Converts the object to the specified CoreType. More... | |
| SizeT | getHashCode () const |
| Returns hash code of the object. More... | |
| ObjectPtr< IString > | toString () const |
| Converts the object to the string object. More... | |
| void | freeze () const |
| Freezes the object. More... | |
| Bool | isFrozen () const |
| Checks if the object is frozen. More... | |
| void | dispatch (const ObjectPtr< IBaseObject > ¶ms) const |
| Calls the stored callback. More... | |
| void | dispatch () const |
| Calls the stored callback without any parameters. More... | |
| void | execute () const |
| Calls the stored callback without any parameters. More... | |
| template<typename... Params> | |
| void | execute (Params... params) const |
| Calls the stored callback. More... | |
| template<typename... Params> | |
| ObjectPtr< IBaseObject > | call (Params... params) const |
| Calls the stored callback and returns the result. More... | |
| bool | isBorrowed () const |
| Checks if the reference is borrowed. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from ObjectPtr< T > | |
| template<class U = T> | |
| static InterfaceToSmartPtr< U >::SmartPtr | Borrow (T *&obj) |
| Borrows an interface. More... | |
| template<typename U = T> | |
| static InterfaceToSmartPtr< U >::SmartPtr | Adopt (T *obj) |
| Adopts an interface. More... | |
| template<class U , class V = T, std::enable_if_t< std::is_base_of_v< IBaseObject, U >, int > = 0> | |
| static InterfaceToSmartPtr< V >::SmartPtr | Borrow (U *&obj) |
| Borrows an interface from the interface of another type. More... | |
| static Bool | Equals (const ObjectPtr< IBaseObject > &a, const ObjectPtr< IBaseObject > &b) |
| Value based comparison of two objects. If both objects are nullptr, they are considered to be equal. More... | |
| void deleteItem | ( | const KeyPtr & | key | ) |
Deletes the element with the specified key.
| key | The key of the element to delete. |
| ValuePtr get | ( | const KeyPtr & | key | ) | const |
Gets the element with the specified key.
| key | The key of the element to get. |
Throws an exception if the key does not exist.
| SizeT getCount |
Gets the number of elements contained in the dictionary.
| IntfID getKeyInterfaceId |
Returns the interface id of the expected key type.
IUnknown. | ListPtr< KeyT, KeyPtr > getKeyList |
Gets the list of all keys in the dictionary.
The order of the keys is not defined.
| IterablePtr< KeyT, KeyPtr > getKeys |
Gets the iterable interface of the keys.
The Iterable object enables iteration through the keys.
| ValuePtr getOrDefault | ( | const KeyPtr & | key, |
| const ValuePtr & | defaultValue = nullptr |
||
| ) | const |
Gets the element with the specified key.
| key | The key of the element to get. |
Returns the default value if the key does not exist.
| IntfID getValueInterfaceId |
Returns the interface id of the expected value type.
IUnknown. | ListPtr< ValueT, ValuePtr > getValueList |
Gets the list of all elements in the dictionary.
The order of the elements is not defined.
| IterablePtr< ValueT, ValuePtr > getValues |
Gets the iterable interface of the elements.
The Iterable object enables iteration through the elements.
| bool hasKey | ( | const KeyPtr & | key | ) | const |
Checks if the element with the specified key exists in the dictionary.
| key | The key of the element to check. |
| ValuePtr remove | ( | const KeyPtr & | key | ) |
Removes the element with the specified key.
| key | The key of the element to remove. |
Throws an exception if the key does not exist.
| void set | ( | const KeyPtr & | key, |
| const ValuePtr & | value | ||
| ) |
Sets the element with the specified key.
| key | The key of the element to set. |
| value | The element with the specified key. |
| bool tryGet | ( | const KeyPtr & | key, |
| ValuePtr & | value | ||
| ) | const |
Gets the element with the specified key.
| key | The key of the element to get. | |
| [out] | value | The element with the specified key. |
| bool tryRemove | ( | const KeyPtr & | key | ) |
Removes the element with the specified key.
| key | The key of the element to remove. |