MySQL 8.3.0
Source Code Documentation
dd::cache::SPI_lru_cache_owner_ptr Class Reference

A smart-pointer for managing an SPI_lru_cache even when it is only forward declared. More...

#include <dictionary_client.h>

Public Member Functions

 ~SPI_lru_cache_owner_ptr ()
 Calls delete on m_spi_lru_cache unless nullptr. More...
 
SPI_lru_cacheoperator-> ()
 Creates cache on demand if m_spi_lru_cache is nullptr. More...
 
const SPI_lru_cacheoperator-> () const
 Const overload which does not create cache on demand, but merely returns the pointer. More...
 
bool is_nullptr () const
 

Private Attributes

SPI_lru_cachem_spi_lru_cache = nullptr
 

Detailed Description

A smart-pointer for managing an SPI_lru_cache even when it is only forward declared.

Automatically allocated cache with new, and assigns m_spi_lru_cache to it, when dereferenced using non-const operator->(). Destructor deletes the object pointed to by m_spi_lru_cache.

Constructor & Destructor Documentation

◆ ~SPI_lru_cache_owner_ptr()

dd::cache::SPI_lru_cache_owner_ptr::~SPI_lru_cache_owner_ptr ( )

Calls delete on m_spi_lru_cache unless nullptr.

Member Function Documentation

◆ is_nullptr()

bool dd::cache::SPI_lru_cache_owner_ptr::is_nullptr ( ) const
inline

◆ operator->() [1/2]

SPI_lru_cache * dd::cache::SPI_lru_cache_owner_ptr::operator-> ( )

Creates cache on demand if m_spi_lru_cache is nullptr.

Returns
pointer to cache.

◆ operator->() [2/2]

const SPI_lru_cache * dd::cache::SPI_lru_cache_owner_ptr::operator-> ( ) const
inline

Const overload which does not create cache on demand, but merely returns the pointer.

Returns
pointer to cache (may be nullptr)

Member Data Documentation

◆ m_spi_lru_cache

SPI_lru_cache* dd::cache::SPI_lru_cache_owner_ptr::m_spi_lru_cache = nullptr
private

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