digiKam Developer Documentation
Professional Photo Management with the Power of Open Source
Loading...
Searching...
No Matches
Digikam::DatabaseFields::Hash< T > Class Template Reference

This class provides a hash on all DatabaseFields enums, allowing to use the enum values as independent keys. More...

+ Inheritance diagram for Digikam::DatabaseFields::Hash< T >:

Public Member Functions

 DATABASEFIELDS_HASH_DECLARE_METHODS (CustomEnum, uniqueKey)
 
 DATABASEFIELDS_HASH_DECLARE_METHODS (ImageHistoryInfo, uniqueKey)
 
 DATABASEFIELDS_HASH_DECLARE_METHODS (ImageMetadata, uniqueKey)
 
 DATABASEFIELDS_HASH_DECLARE_METHODS (Images, uniqueKey)
 
 DATABASEFIELDS_HASH_DECLARE_METHODS (ItemComments, uniqueKey)
 
 DATABASEFIELDS_HASH_DECLARE_METHODS (ItemInformation, uniqueKey)
 
 DATABASEFIELDS_HASH_DECLARE_METHODS (ItemPositions, uniqueKey)
 
 DATABASEFIELDS_HASH_DECLARE_METHODS (VideoMetadata, uniqueKey)
 

Static Public Member Functions

static unsigned int uniqueKey (CustomEnum f)
 
static unsigned int uniqueKey (ImageHistoryInfo f)
 
static unsigned int uniqueKey (ImageMetadata f)
 
static unsigned int uniqueKey (Images f)
 
static unsigned int uniqueKey (ItemComments f)
 
static unsigned int uniqueKey (ItemInformation f)
 
static unsigned int uniqueKey (ItemPositions f)
 
static unsigned int uniqueKey (VideoMetadata f)
 

Detailed Description

template<class T>
class Digikam::DatabaseFields::Hash< T >

You can use the class like a normal QHash with the value type defined by you, and as keys the members of the DatabaseFields enums. You can only use single enum members as keys, not or'ed numbers. You can use one custom enum, cast to DatabaseFields::CustomEnum, which can have at most 26 flag values (1 << 0 to 1 << 26). Pass this as the optional second template parameter.

Member Function Documentation

◆ uniqueKey()

template<class T >
static unsigned int Digikam::DatabaseFields::Hash< T >::uniqueKey ( Images  f)
inlinestatic
Note
We use the upper 6 bits to distinguish the enums, and give the lower 26 bits to the flags. So we can store up to 64 enums, with 26 flags each.