MySQL 8.0.40
Source Code Documentation
Map_with_rw_lock< K, V > Class Template Reference

Map with RWLock protections. More...

#include <auth_utility.h>

Public Member Functions

 Map_with_rw_lock (PSI_rwlock_key key)
 
 Map_with_rw_lock (const Map_with_rw_lock &)=delete
 
 Map_with_rw_lock (Map_with_rw_lock &&)=delete
 
Map_with_rw_lockoperator= (const Map_with_rw_lock &)=delete
 
Map_with_rw_lockoperator= (Map_with_rw_lock &&)=delete
 
 ~Map_with_rw_lock ()
 
bool find (const K &key, V &value)
 Search an entry. More...
 
bool insert (K key, V value)
 Insert an entry. More...
 
void erase (K key)
 Delete an entry. More...
 
void clear_if_greater (size_t size)
 Check limit and clear if needed. More...
 
size_t size ()
 Get the size of the map. More...
 

Private Attributes

std::map< K, V > m_map
 Map. More...
 
mysql_rwlock_t m_lock
 Lock to protect m_map. More...
 

Detailed Description

template<typename K, typename V>
class Map_with_rw_lock< K, V >

Map with RWLock protections.

Constructor & Destructor Documentation

◆ Map_with_rw_lock() [1/3]

template<typename K , typename V >
Map_with_rw_lock< K, V >::Map_with_rw_lock ( PSI_rwlock_key  key)
inline

◆ Map_with_rw_lock() [2/3]

template<typename K , typename V >
Map_with_rw_lock< K, V >::Map_with_rw_lock ( const Map_with_rw_lock< K, V > &  )
delete

◆ Map_with_rw_lock() [3/3]

template<typename K , typename V >
Map_with_rw_lock< K, V >::Map_with_rw_lock ( Map_with_rw_lock< K, V > &&  )
delete

◆ ~Map_with_rw_lock()

template<typename K , typename V >
Map_with_rw_lock< K, V >::~Map_with_rw_lock ( )
inline

Member Function Documentation

◆ clear_if_greater()

template<typename K , typename V >
void Map_with_rw_lock< K, V >::clear_if_greater ( size_t  size)
inline

Check limit and clear if needed.

Parameters
[in]sizeLimit to check against

◆ erase()

template<typename K , typename V >
void Map_with_rw_lock< K, V >::erase ( key)
inline

Delete an entry.

Parameters
[in]keyKey to the element to be erased

◆ find()

template<typename K , typename V >
bool Map_with_rw_lock< K, V >::find ( const K &  key,
V &  value 
)
inline

Search an entry.

Parameters
[in]keyKey
[out]valueValue
Returns
status of search
Return values
falseEntry not found
trueEntry found. Check value.

◆ insert()

template<typename K , typename V >
bool Map_with_rw_lock< K, V >::insert ( key,
value 
)
inline

Insert an entry.

Parameters
[in]keyKey
[in]valueValue
Returns
status of insertion
Return values
falseError
trueSuccess

◆ operator=() [1/2]

template<typename K , typename V >
Map_with_rw_lock & Map_with_rw_lock< K, V >::operator= ( const Map_with_rw_lock< K, V > &  )
delete

◆ operator=() [2/2]

template<typename K , typename V >
Map_with_rw_lock & Map_with_rw_lock< K, V >::operator= ( Map_with_rw_lock< K, V > &&  )
delete

◆ size()

template<typename K , typename V >
size_t Map_with_rw_lock< K, V >::size ( )
inline

Get the size of the map.

Member Data Documentation

◆ m_lock

template<typename K , typename V >
mysql_rwlock_t Map_with_rw_lock< K, V >::m_lock
private

Lock to protect m_map.

◆ m_map

template<typename K , typename V >
std::map<K, V> Map_with_rw_lock< K, V >::m_map
private

Map.


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