Iguana 0.0.0
Implementation Guardian of Analysis Algorithms
Loading...
Searching...
No Matches
iguana::MemoizedParam< T > Class Template Reference

#include <ConcurrentParam.h>

Detailed Description

template<typename T>
class iguana::MemoizedParam< T >

an iguana::ConcurrentParam that uses memoization for thread safety; used when iguana::GlobalConcurrencyModel is "memoize"

Definition at line 95 of file ConcurrentParam.h.

Public Member Functions

T const Load (concurrent_key_t const key) const override
 access a stored value
 
void Save (T const &value, concurrent_key_t const key) override
 modify a value
 
bool HasKey (concurrent_key_t const key) const override
 
std::size_t GetSize () const override
 
- Public Member Functions inherited from iguana::ConcurrentParam< T >
 ConcurrentParam (std::string const &model)
 
bool NeedsHashing () const
 whether or not hashing is needed to use this parameter
 
bool IsEmpty () const
 

Additional Inherited Members

- Protected Attributes inherited from iguana::ConcurrentParam< T >
bool m_needs_hashing
 whether this ConcurrentParam needs hashing for calling Load or Save
 
std::mutex m_mutex
 mutex for this ConcurrentParam
 
bool m_empty {true}
 whether this ConcurrentParam has something saved
 
Inheritance diagram for iguana::MemoizedParam< T >:
Inheritance graph

Member Function Documentation

◆ GetSize()

template<typename T >
std::size_t iguana::MemoizedParam< T >::GetSize ( ) const
overridevirtual
Returns
the size of the internal data storage container

Implements iguana::ConcurrentParam< T >.

◆ HasKey()

template<typename T >
bool iguana::MemoizedParam< T >::HasKey ( concurrent_key_t const key) const
overridevirtual
Parameters
keythe key
Returns
true if key key is used

Implements iguana::ConcurrentParam< T >.

◆ Load()

template<typename T >
T const iguana::MemoizedParam< T >::Load ( concurrent_key_t const key) const
overridevirtual

access a stored value

Parameters
keythe access key
Returns
the stored value

Implements iguana::ConcurrentParam< T >.

◆ Save()

template<typename T >
void iguana::MemoizedParam< T >::Save ( T const & value,
concurrent_key_t const key )
overridevirtual

modify a value

Parameters
valuethe value
keythe access key

Implements iguana::ConcurrentParam< T >.


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