Blender V5.0
blender::memory_cache::LoadFileKey Class Reference

Inherits blender::GenericKey.

Public Member Functions

 LoadFileKey (Vector< std::string > file_paths, std::shared_ptr< const GenericKey > loader_key)
Span< std::string > file_paths () const
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

Friends

bool operator== (const LoadFileKey &a, const LoadFileKey &b)

Detailed Description

A key used to identify data loaded from one or more files.

Definition at line 21 of file memory_cache_file_load.cc.

Constructor & Destructor Documentation

◆ LoadFileKey()

blender::memory_cache::LoadFileKey::LoadFileKey ( Vector< std::string > file_paths,
std::shared_ptr< const GenericKey > loader_key )
inline

Definition at line 32 of file memory_cache_file_load.cc.

References file_paths().

Referenced by equal_to(), and operator==.

Member Function Documentation

◆ equal_to()

bool blender::memory_cache::LoadFileKey::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 52 of file memory_cache_file_load.cc.

References LoadFileKey().

◆ file_paths()

Span< std::string > blender::memory_cache::LoadFileKey::file_paths ( ) const
inline

Definition at line 37 of file memory_cache_file_load.cc.

Referenced by LoadFileKey().

◆ hash()

uint64_t blender::memory_cache::LoadFileKey::hash ( ) const
inlineoverridevirtual

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

Implements blender::GenericKey.

Definition at line 42 of file memory_cache_file_load.cc.

References blender::get_default_hash().

◆ to_storable()

std::unique_ptr< GenericKey > blender::memory_cache::LoadFileKey::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 60 of file memory_cache_file_load.cc.

◆ operator==

bool operator== ( const LoadFileKey & a,
const LoadFileKey & b )
friend

Definition at line 47 of file memory_cache_file_load.cc.

References b, and LoadFileKey().


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