|
Blender V4.3
|
#include <BLI_generic_key.hh>
Inherited by blender::memory_cache::tests::GenericIntKey.
Public Member Functions | |
| virtual | ~GenericKey ()=default |
| virtual uint64_t | hash () const =0 |
| virtual bool | equal_to (const GenericKey &other) const =0 |
| virtual std::unique_ptr< GenericKey > | to_storable () const =0 |
Friends | |
| bool | operator== (const GenericKey &a, const GenericKey &b) |
| bool | operator!= (const GenericKey &a, const GenericKey &b) |
A #GenericKey allows different kinds of keys to be used in the same data-structure like a #Set or #Map.
Typically, the key is stored as std::reference_wrapper<const GenericKey> in the data-structure. That implies that one has to make sure that the key is not destructed while it's still in use.
Definition at line 25 of file BLI_generic_key.hh.
|
virtualdefault |
|
pure virtual |
Check if the other key is equal to this one. Usually that involves a dynamic_cast to check if it has the same type.
Implemented in blender::memory_cache::tests::GenericIntKey.
|
pure virtual |
The hash function has to be implemented by the non-abstract subclass.
Implemented in blender::memory_cache::tests::GenericIntKey.
|
pure virtual |
For efficiency, it can be good to not always allocate the key if it's just used for lookup. This method allows the key to be converted into a heap-allocated version that can be stored safely if necessary.
Implemented in blender::memory_cache::tests::GenericIntKey.
Referenced by blender::memory_cache::get_base().
|
friend |
Definition at line 53 of file BLI_generic_key.hh.
|
friend |
Definition at line 45 of file BLI_generic_key.hh.