local pool var update

This commit is contained in:
Robin Müller 2020-08-08 13:20:02 +02:00
parent fba8775f49
commit 121e94a385
2 changed files with 10 additions and 0 deletions

View File

@ -116,6 +116,8 @@ public:
*/ */
ReturnValue_t commit(dur_millis_t lockTimeout = MutexIF::BLOCKING) override; ReturnValue_t commit(dur_millis_t lockTimeout = MutexIF::BLOCKING) override;
LocalPoolVar<T> &operator=(T newValue);
protected: protected:
/** /**
* @brief Like #read, but without a lock protection of the global pool. * @brief Like #read, but without a lock protection of the global pool.
@ -170,4 +172,5 @@ using lp_int64_t = LocalPoolVar<int64_t>;
using lp_float_t = LocalPoolVar<float>; using lp_float_t = LocalPoolVar<float>;
using lp_double_t = LocalPoolVar<double>; using lp_double_t = LocalPoolVar<double>;
#endif #endif

View File

@ -103,6 +103,13 @@ inline ReturnValue_t LocalPoolVar<T>::commitWithoutLock() {
return RETURN_OK; return RETURN_OK;
} }
template<typename T>
inline LocalPoolVar<T> & LocalPoolVar<T>::operator =(T newValue) {
value = newValue;
return *this;
}
template<typename T> template<typename T>
inline pool_rwm_t LocalPoolVar<T>::getReadWriteMode() const { inline pool_rwm_t LocalPoolVar<T>::getReadWriteMode() const {
return readWriteMode; return readWriteMode;