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

#include <ConcurrentParam.h>

Detailed Description

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

a parameter that is not thread safe; used when iguana::GlobalConcurrencyModel is "single"

Definition at line 66 of file ConcurrentParam.h.

Public Member Functions

 SingleThreadParam (std::string const &name)
bool HasKey (concurrent_key_t const key) const override
T const Load (concurrent_key_t const key) const override
 access a stored value
bool NeedsUpdate (T const &value, concurrent_key_t const key) const override
 if either key is not found or value does not match the value at key, the caller likely needs to call Save
void Save (T const &value, concurrent_key_t const key) override
 modify a value
Public Member Functions inherited from iguana::ConcurrentParam< T >
 ConcurrentParam (std::string const &model, std::string const &name)

Additional Inherited Members

Protected Attributes inherited from iguana::ConcurrentParam< T >
std::shared_mutex m_mutex
 mutex for this ConcurrentParam
std::string const m_name
 a name for this parameter
Inheritance diagram for iguana::SingleThreadParam< T >:
Inheritance graph

Constructor & Destructor Documentation

◆ SingleThreadParam()

template<typename T>
iguana::SingleThreadParam< T >::SingleThreadParam ( std::string const & name)
Parameters
namethe name of this parameter

Member Function Documentation

◆ HasKey()

template<typename T>
bool iguana::SingleThreadParam< 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::SingleThreadParam< 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 >.

◆ NeedsUpdate()

template<typename T>
bool iguana::SingleThreadParam< T >::NeedsUpdate ( T const & value,
concurrent_key_t const key ) const
overridevirtual

if either key is not found or value does not match the value at key, the caller likely needs to call Save

Parameters
valuethe expected value
keythe key for the expected value
Returns
true if update is needed

Implements iguana::ConcurrentParam< T >.

◆ Save()

template<typename T>
void iguana::SingleThreadParam< 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: