|
Krita Source Code Documentation
|
#include <KoGenericRegistry.h>
Public Member Functions | |
| void | add (const QString &id, T item) |
| void | add (T item) |
| void | addAlias (const QString &alias, const QString &id) |
| QHash< QString, T >::const_iterator | constBegin () const |
| QHash< QString, T >::const_iterator | constEnd () const |
| bool | contains (const QString &id) const |
| int | count () const |
| QList< T > | doubleEntries () const |
| T | get (const QString &id) const |
| QList< QString > | keys () const |
| KoGenericRegistry () | |
| void | remove (const QString &id) |
| void | removeAlias (const QString &alias) |
| const T | value (const QString &id) const |
| QList< T > | values () const |
| virtual | ~KoGenericRegistry () |
Private Attributes | |
| QHash< QString, QString > | m_aliases |
| QList< T > | m_doubleEntries |
| QHash< QString, T > | m_hash |
Base class for registry objects.
Registered objects are owned by the registry.
Items are mapped by QString as a unique Id.
Example of use:
Definition at line 46 of file KoGenericRegistry.h.
|
inline |
Definition at line 49 of file KoGenericRegistry.h.
|
inlinevirtual |
Definition at line 50 of file KoGenericRegistry.h.
References KoGenericRegistry< T >::m_doubleEntries, and KoGenericRegistry< T >::m_hash.
|
inline |
add an object to the registry
| id | the id of the object |
| item | the item to add |
Definition at line 83 of file KoGenericRegistry.h.
References KIS_SAFE_ASSERT_RECOVER_NOOP, KIS_SAFE_ASSERT_RECOVER_RETURN, KoGenericRegistry< T >::m_aliases, KoGenericRegistry< T >::m_doubleEntries, KoGenericRegistry< T >::m_hash, KoGenericRegistry< T >::remove(), and KoGenericRegistry< T >::value().
|
inline |
Add an object to the registry. If it is a QObject, make sure it isn't in the QObject ownership hierarchy, since the registry itself is responsible for deleting it.
| item | the item to add (NOTE: T must have an QString id() const function) |
Definition at line 64 of file KoGenericRegistry.h.
References KIS_SAFE_ASSERT_RECOVER_NOOP, KIS_SAFE_ASSERT_RECOVER_RETURN, KoGenericRegistry< T >::m_aliases, KoGenericRegistry< T >::m_doubleEntries, KoGenericRegistry< T >::m_hash, KoGenericRegistry< T >::remove(), and KoGenericRegistry< T >::value().
|
inline |
Definition at line 103 of file KoGenericRegistry.h.
References KIS_SAFE_ASSERT_RECOVER_NOOP, KoGenericRegistry< T >::m_aliases, and KoGenericRegistry< T >::m_hash.
|
inline |
Definition at line 179 of file KoGenericRegistry.h.
References KoGenericRegistry< T >::m_hash.
|
inline |
Definition at line 183 of file KoGenericRegistry.h.
References KoGenericRegistry< T >::m_hash.
|
inline |
| id | the unique identifier string |
Definition at line 130 of file KoGenericRegistry.h.
References KoGenericRegistry< T >::m_aliases, and KoGenericRegistry< T >::m_hash.
|
inline |
Definition at line 164 of file KoGenericRegistry.h.
References KoGenericRegistry< T >::m_hash.
|
inline |
Definition at line 174 of file KoGenericRegistry.h.
References KoGenericRegistry< T >::m_doubleEntries.
|
inline |
Retrieve the object from the registry based on the unique identifier string.
| id | the id |
Definition at line 120 of file KoGenericRegistry.h.
References KoGenericRegistry< T >::value().
|
inline |
Definition at line 159 of file KoGenericRegistry.h.
References KoGenericRegistry< T >::m_hash.
|
inline |
This function removes an item from the registry
Definition at line 98 of file KoGenericRegistry.h.
References KoGenericRegistry< T >::m_hash.
|
inline |
Definition at line 109 of file KoGenericRegistry.h.
References KoGenericRegistry< T >::m_aliases.
|
inline |
Retrieve the object from the registry based on the unique identifier string
| id | the id |
Definition at line 145 of file KoGenericRegistry.h.
References KoGenericRegistry< T >::m_aliases, and KoGenericRegistry< T >::m_hash.
|
inline |
Definition at line 169 of file KoGenericRegistry.h.
References KoGenericRegistry< T >::m_hash.
|
private |
Definition at line 194 of file KoGenericRegistry.h.
|
private |
Definition at line 189 of file KoGenericRegistry.h.
|
private |
Definition at line 193 of file KoGenericRegistry.h.