1
0
forked from fsfw/fsfw

compiling again

This commit is contained in:
2020-11-30 16:06:59 +01:00
parent f70ee7696a
commit 4bb9dd816e
12 changed files with 196 additions and 132 deletions

View File

@ -67,3 +67,7 @@ void LocalPoolObjectBase::setChanged(bool changed) {
bool LocalPoolObjectBase::hasChanged() const {
return changed;
}
void LocalPoolObjectBase::setReadWriteMode(pool_rwm_t newReadWriteMode) {
this->readWriteMode = newReadWriteMode;
}

View File

@ -18,6 +18,7 @@ public:
DataSetIF* dataSet = nullptr,
pool_rwm_t setReadWriteMode = pool_rwm_t::VAR_READ_WRITE);
void setReadWriteMode(pool_rwm_t newReadWriteMode);
pool_rwm_t getReadWriteMode() const;
bool isValid() const override;

View File

@ -118,8 +118,21 @@ public:
ReturnValue_t commit(dur_millis_t lockTimeout = MutexIF::BLOCKING) override;
LocalPoolVar<T> &operator=(T newValue);
LocalPoolVar<T> &operator=(LocalPoolVar<T> newPoolVariable);
LocalPoolVar<T> &operator=(const T& newValue);
LocalPoolVar<T> &operator=(const LocalPoolVar<T>& newPoolVariable);
bool operator==(const LocalPoolVar<T>& other) const;
bool operator==(const T& other) const;
bool operator!=(const LocalPoolVar<T>& other) const;
bool operator!=(const T& other) const;
bool operator<(const LocalPoolVar<T>& other) const;
bool operator<(const T& other) const;
bool operator>(const LocalPoolVar<T>& other) const;
bool operator>(const T& other) const;
protected:
/**
* @brief Like #read, but without a lock protection of the global pool.
@ -165,5 +178,4 @@ using lp_int64_t = LocalPoolVar<int64_t>;
using lp_float_t = LocalPoolVar<float>;
using lp_double_t = LocalPoolVar<double>;
#endif /* FSFW_DATAPOOLLOCAL_LOCALPOOLVARIABLE_H_ */

View File

@ -81,14 +81,14 @@ inline ReturnValue_t LocalPoolVar<T>::commitWithoutLock() {
}
template<typename T>
inline LocalPoolVar<T> & LocalPoolVar<T>::operator=(T newValue) {
inline LocalPoolVar<T> & LocalPoolVar<T>::operator=(const T& newValue) {
value = newValue;
return *this;
}
template<typename T>
inline LocalPoolVar<T>& LocalPoolVar<T>::operator =(
LocalPoolVar<T> newPoolVariable) {
const LocalPoolVar<T>& newPoolVariable) {
value = newPoolVariable.value;
return *this;
}
@ -119,4 +119,47 @@ inline std::ostream& operator<< (std::ostream &out,
return out;
}
#endif
template<typename T>
inline bool LocalPoolVar<T>::operator ==(const LocalPoolVar<T> &other) const {
return this->value == other.value;
}
template<typename T>
inline bool LocalPoolVar<T>::operator ==(const T &other) const {
return this->value == other;
}
template<typename T>
inline bool LocalPoolVar<T>::operator !=(const LocalPoolVar<T> &other) const {
return not (*this == other);
}
template<typename T>
inline bool LocalPoolVar<T>::operator !=(const T &other) const {
return not (*this == other);
}
template<typename T>
inline bool LocalPoolVar<T>::operator <(const LocalPoolVar<T> &other) const {
return this->value < other.value;
}
template<typename T>
inline bool LocalPoolVar<T>::operator <(const T &other) const {
return this->value < other;
}
template<typename T>
inline bool LocalPoolVar<T>::operator >(const LocalPoolVar<T> &other) const {
return not (*this < other);
}
template<typename T>
inline bool LocalPoolVar<T>::operator >(const T &other) const {
return not (*this < other);
}
#endif /* FSFW_DATAPOOLLOCAL_LOCALPOOLVARIABLE_TPP_ */