Blender V5.0
blender::GenericStringKey Class Reference

#include <BLI_generic_key_string.hh>

Inherits blender::GenericKey, and blender::NonMovable.

Public Member Functions

 GenericStringKey (StringRef 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

Utility class that to easy create a GenericKey from a string.

Definition at line 15 of file BLI_generic_key_string.hh.

Constructor & Destructor Documentation

◆ GenericStringKey()

blender::GenericStringKey::GenericStringKey ( StringRef value)
inline

Definition at line 22 of file BLI_generic_key_string.hh.

Referenced by equal_to().

Member Function Documentation

◆ equal_to()

bool blender::GenericStringKey::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 31 of file BLI_generic_key_string.hh.

References equal_to(), and GenericStringKey().

Referenced by equal_to().

◆ hash()

uint64_t blender::GenericStringKey::hash ( ) const
inlineoverridevirtual

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

Implements blender::GenericKey.

Definition at line 24 of file BLI_generic_key_string.hh.

References blender::get_default_hash().

◆ to_storable()

std::unique_ptr< GenericKey > blender::GenericStringKey::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 39 of file BLI_generic_key_string.hh.


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