Blender V4.3
intern::memutil::AllocStringStorage< keyT, hashT > Class Template Reference

#include <MEM_alloc_string_storage.hh>

Public Member Functions

bool contains (const keyT &key)
 
const char * find (const keyT &key)
 
const char * insert (const keyT &key, std::string alloc_string)
 

Detailed Description

template<typename keyT, template< typename > typename hashT>
class intern::memutil::AllocStringStorage< keyT, hashT >

A 'static' storage of allocation strings, with a simple API to set and retrieve them.

This is a templated wrapper around a std::unordered_map, to allow custom key types.

Definition at line 25 of file MEM_alloc_string_storage.hh.

Member Function Documentation

◆ contains()

template<typename keyT , template< typename > typename hashT>
bool intern::memutil::AllocStringStorage< keyT, hashT >::contains ( const keyT & key)
inline

Check whether the given key exists in the storage.

Returns
true if the key is found in storage, false otherwise.

Definition at line 34 of file MEM_alloc_string_storage.hh.

Referenced by get_alloc_name().

◆ find()

template<typename keyT , template< typename > typename hashT>
const char * intern::memutil::AllocStringStorage< keyT, hashT >::find ( const keyT & key)
inline

Return the alloc string for the given key in the storage.

Returns
A pointer to the stored string if key is found, nullptr otherwise.

Definition at line 44 of file MEM_alloc_string_storage.hh.

Referenced by get_alloc_name().

◆ insert()

template<typename keyT , template< typename > typename hashT>
const char * intern::memutil::AllocStringStorage< keyT, hashT >::insert ( const keyT & key,
std::string alloc_string )
inline

Insert the given alloc string in the storage, at the given key, and return a pointer to the stored string.

Parameters
alloc_stringThe alloc string to store at key.
Returns
A pointer to the inserted stored string.

Definition at line 59 of file MEM_alloc_string_storage.hh.

Referenced by get_alloc_name().


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