Blender V4.3
blender::memory_cache::tests::GenericIntKey Class Reference

Inherits blender::GenericKey.

Public Member Functions

 GenericIntKey (int value)
 
uint64_t hash () const override
 
bool equal_to (const GenericKey &other) const override
 
std::unique_ptr< GenericKeyto_storable () const override
 
- Public Member Functions inherited from blender::GenericKey
virtual ~GenericKey ()=default
 

Detailed Description

Definition at line 15 of file BLI_memory_cache_test.cc.

Constructor & Destructor Documentation

◆ GenericIntKey()

blender::memory_cache::tests::GenericIntKey::GenericIntKey ( int value)
inline

Definition at line 20 of file BLI_memory_cache_test.cc.

Member Function Documentation

◆ equal_to()

bool blender::memory_cache::tests::GenericIntKey::equal_to ( const GenericKey & other) const
inlineoverridevirtual

Check if the other key is equal to this one. Usually that involves a dynamic_cast to check if it has the same type.

Implements blender::GenericKey.

Definition at line 27 of file BLI_memory_cache_test.cc.

◆ hash()

uint64_t blender::memory_cache::tests::GenericIntKey::hash ( ) const
inlineoverridevirtual

The hash function has to be implemented by the non-abstract subclass.

Implements blender::GenericKey.

Definition at line 22 of file BLI_memory_cache_test.cc.

References blender::get_default_hash().

◆ to_storable()

std::unique_ptr< GenericKey > blender::memory_cache::tests::GenericIntKey::to_storable ( ) const
inlineoverridevirtual

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.

Implements blender::GenericKey.

Definition at line 35 of file BLI_memory_cache_test.cc.


The documentation for this class was generated from the following file: