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

#include <ConcurrentParam.h>

Detailed Description

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

abstract base class for concurrently mutable configuration parameters

See also
iguana::ConcurrentParamFactory for instantiation

Definition at line 17 of file ConcurrentParam.h.

Public Member Functions

 ConcurrentParam (std::string const &model)
 
virtual T const Load (concurrent_key_t const key) const =0
 access a stored value
 
virtual void Save (T const &value, concurrent_key_t const key)=0
 modify a value
 
virtual bool HasKey (concurrent_key_t const key) const =0
 
bool NeedsHashing () const
 whether or not hashing is needed to use this parameter
 
virtual std::size_t GetSize () const =0
 
bool IsEmpty () const
 

Protected Attributes

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::ConcurrentParam< T >:
Inheritance graph

Constructor & Destructor Documentation

◆ ConcurrentParam()

template<typename T >
iguana::ConcurrentParam< T >::ConcurrentParam ( std::string const & model)
Parameters
modelthe concurrency model this instance must be
See also
ConcurrentParamFactory, the preferred instantiation method

Member Function Documentation

◆ GetSize()

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

Implemented in iguana::MemoizedParam< T >, and iguana::SingleThreadParam< T >.

◆ HasKey()

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

Implemented in iguana::MemoizedParam< T >, and iguana::SingleThreadParam< T >.

◆ IsEmpty()

template<typename T >
bool iguana::ConcurrentParam< T >::IsEmpty ( ) const
inline
Returns
true if no value has been saved

Definition at line 48 of file ConcurrentParam.h.

◆ Load()

template<typename T >
virtual T const iguana::ConcurrentParam< T >::Load ( concurrent_key_t const key) const
pure virtual

access a stored value

Parameters
keythe access key
Returns
the stored value

Implemented in iguana::MemoizedParam< T >, and iguana::SingleThreadParam< T >.

◆ NeedsHashing()

template<typename T >
bool iguana::ConcurrentParam< T >::NeedsHashing ( ) const
inline

whether or not hashing is needed to use this parameter

Returns
true if hashing is needed

Definition at line 42 of file ConcurrentParam.h.

◆ Save()

template<typename T >
virtual void iguana::ConcurrentParam< T >::Save ( T const & value,
concurrent_key_t const key )
pure virtual

modify a value

Parameters
valuethe value
keythe access key

Implemented in iguana::MemoizedParam< T >, and iguana::SingleThreadParam< T >.

Member Data Documentation

◆ m_empty

template<typename T >
bool iguana::ConcurrentParam< T >::m_empty {true}
protected

whether this ConcurrentParam has something saved

Definition at line 59 of file ConcurrentParam.h.

◆ m_mutex

template<typename T >
std::mutex iguana::ConcurrentParam< T >::m_mutex
protected

mutex for this ConcurrentParam

Definition at line 56 of file ConcurrentParam.h.

◆ m_needs_hashing

template<typename T >
bool iguana::ConcurrentParam< T >::m_needs_hashing
protected

whether this ConcurrentParam needs hashing for calling Load or Save

Definition at line 53 of file ConcurrentParam.h.


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