MySQL 8.0.40
Source Code Documentation
keyring_common::cache::Datacache< Data_extension > Class Template Referencefinal

#include <cache.h>

Public Member Functions

 Datacache ()
 Constructor. More...
 
 Datacache (const Datacache &src)=delete
 Disable copy. More...
 
 Datacache (Datacache &&src)=delete
 
Datacacheoperator= (const Datacache &src)=delete
 
Datacacheoperator= (Datacache &&src)=delete
 
 ~Datacache ()=default
 Destructor. More...
 
bool get (const meta::Metadata metadata, Data_extension &data) const
 Retrieve an element from cache. More...
 
bool store (const meta::Metadata metadata, const Data_extension data)
 Store and element in cache. More...
 
bool erase (const meta::Metadata metadata)
 Remove an entry from cache. More...
 
void clear ()
 Clear the cache. More...
 
bool empty () const
 Check if cache is empty. More...
 
size_t size () const
 Get size. More...
 
size_t version () const
 Get cache version. More...
 
Cache< Data_extension >::const_iterator begin () const
 
Cache< Data_extension >::const_iterator end () const
 
Cache< Data_extension >::const_iterator at (const meta::Metadata metadata) const
 Retrieve iterator at an element from cache. More...
 

Private Attributes

Cache< Data_extension > cache_
 Sensitive data cache. More...
 
size_t version_ {0}
 Cache version. More...
 

Constructor & Destructor Documentation

◆ Datacache() [1/3]

template<typename Data_extension = data::Data>
keyring_common::cache::Datacache< Data_extension >::Datacache ( )
inlineexplicit

Constructor.

◆ Datacache() [2/3]

template<typename Data_extension = data::Data>
keyring_common::cache::Datacache< Data_extension >::Datacache ( const Datacache< Data_extension > &  src)
delete

Disable copy.

◆ Datacache() [3/3]

template<typename Data_extension = data::Data>
keyring_common::cache::Datacache< Data_extension >::Datacache ( Datacache< Data_extension > &&  src)
delete

◆ ~Datacache()

template<typename Data_extension = data::Data>
keyring_common::cache::Datacache< Data_extension >::~Datacache ( )
default

Destructor.

Member Function Documentation

◆ at()

template<typename Data_extension = data::Data>
Cache< Data_extension >::const_iterator keyring_common::cache::Datacache< Data_extension >::at ( const meta::Metadata  metadata) const
inline

Retrieve iterator at an element from cache.

Parameters
[in]metadataKey to search data

◆ begin()

template<typename Data_extension = data::Data>
Cache< Data_extension >::const_iterator keyring_common::cache::Datacache< Data_extension >::begin ( ) const
inline

◆ clear()

template<typename Data_extension = data::Data>
void keyring_common::cache::Datacache< Data_extension >::clear ( )
inline

Clear the cache.

◆ empty()

template<typename Data_extension = data::Data>
bool keyring_common::cache::Datacache< Data_extension >::empty ( ) const
inline

Check if cache is empty.

◆ end()

template<typename Data_extension = data::Data>
Cache< Data_extension >::const_iterator keyring_common::cache::Datacache< Data_extension >::end ( ) const
inline

◆ erase()

template<typename Data_extension = data::Data>
bool keyring_common::cache::Datacache< Data_extension >::erase ( const meta::Metadata  metadata)
inline

Remove an entry from cache.

Parameters
[in]metadataKey to entry to be erased
Returns
status of find operation
Return values
trueSuccess. Data removed successfully.
falseFailure. Either key is not present or removal failed.

◆ get()

template<typename Data_extension = data::Data>
bool keyring_common::cache::Datacache< Data_extension >::get ( const meta::Metadata  metadata,
Data_extension &  data 
) const
inline

Retrieve an element from cache.

Parameters
[in]metadataKey to search data
[out]dataFetched data. Can be empty.
Returns
status of find operation
Return values
trueSuccess. data contains retrieved data.
falseFailure. data may not contain a valid value.

◆ operator=() [1/2]

template<typename Data_extension = data::Data>
Datacache & keyring_common::cache::Datacache< Data_extension >::operator= ( const Datacache< Data_extension > &  src)
delete

◆ operator=() [2/2]

template<typename Data_extension = data::Data>
Datacache & keyring_common::cache::Datacache< Data_extension >::operator= ( Datacache< Data_extension > &&  src)
delete

◆ size()

template<typename Data_extension = data::Data>
size_t keyring_common::cache::Datacache< Data_extension >::size ( ) const
inline

Get size.

◆ store()

template<typename Data_extension = data::Data>
bool keyring_common::cache::Datacache< Data_extension >::store ( const meta::Metadata  metadata,
const Data_extension  data 
)
inline

Store and element in cache.

Parameters
[in]metadataKey to store data
[in]dataActual data. Can be empty.
Returns
status of insert operation
Return values
trueSuccess
falseError. Element already exists in the cache.

◆ version()

template<typename Data_extension = data::Data>
size_t keyring_common::cache::Datacache< Data_extension >::version ( ) const
inline

Get cache version.

Member Data Documentation

◆ cache_

template<typename Data_extension = data::Data>
Cache<Data_extension> keyring_common::cache::Datacache< Data_extension >::cache_
private

Sensitive data cache.

◆ version_

template<typename Data_extension = data::Data>
size_t keyring_common::cache::Datacache< Data_extension >::version_ {0}
private

Cache version.


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