WIP: somethings wrong.. #19
@ -87,8 +87,6 @@ inline ReturnValue_t LocalPoolVar<T>::commitWithoutLock() {
|
||||
"mode for commit() call." << std::endl;
|
||||
return PoolVariableIF::INVALID_READ_WRITE_MODE;
|
||||
}
|
||||
// Wait maximum of 50 milliseconds.
|
||||
MutexHelper(hkManager->getMutexHandle(), 50);
|
||||
PoolEntry<T>* poolEntry = nullptr;
|
||||
ReturnValue_t result = hkManager->fetchPoolEntry(localPoolId, &poolEntry);
|
||||
if(result != RETURN_OK) {
|
||||
|
@ -70,8 +70,9 @@ public:
|
||||
|
||||
/**
|
||||
* @brief This is the local copy of the data pool entry.
|
||||
* @details The user can work on this attribute
|
||||
* just like he would on a local array of this type.
|
||||
* @details
|
||||
* The user can work on this attribute just like he would on a local
|
||||
* array of this type.
|
||||
*/
|
||||
T value[vectorSize];
|
||||
/**
|
||||
@ -109,7 +110,7 @@ public:
|
||||
void setValid(bool valid) override;
|
||||
uint8_t getValid() const;
|
||||
|
||||
T &operator [](int i);
|
||||
T& operator [](int i);
|
||||
const T &operator [](int i) const;
|
||||
|
||||
virtual ReturnValue_t serialize(uint8_t** buffer, size_t* size,
|
||||
@ -142,6 +143,7 @@ public:
|
||||
* at once to avoid the overhead of unnecessary lock und unlock operations.
|
||||
*/
|
||||
ReturnValue_t commit(uint32_t lockTimeout = MutexIF::BLOCKING) override;
|
||||
|
||||
protected:
|
||||
/**
|
||||
* @brief Like #read, but without a lock protection of the global pool.
|
||||
@ -185,6 +187,8 @@ private:
|
||||
template <typename U, uint16_t otherSize>
|
||||
friend std::ostream& operator<< (std::ostream &out,
|
||||
const LocalPoolVector<U, otherSize> &var);
|
||||
|
||||
|
||||
};
|
||||
|
||||
#include <framework/datapoollocal/LocalPoolVector.tpp>
|
||||
|
@ -85,8 +85,6 @@ inline ReturnValue_t LocalPoolVector<T, vectorSize>::commitWithoutLock() {
|
||||
"mode for commit() call." << std::endl;
|
||||
return PoolVariableIF::INVALID_READ_WRITE_MODE;
|
||||
}
|
||||
// Wait maximum of 50 milliseconds.
|
||||
MutexHelper(hkManager->getMutexHandle(), 50);
|
||||
PoolEntry<T>* poolEntry = nullptr;
|
||||
ReturnValue_t result = hkManager->fetchPoolEntry(localPoolId, &poolEntry);
|
||||
if(result != RETURN_OK) {
|
||||
@ -106,8 +104,11 @@ inline T& LocalPoolVector<T, vectorSize>::operator [](int i) {
|
||||
if(i <= vectorSize) {
|
||||
return value[i];
|
||||
}
|
||||
sif::warning << "LocalPoolVector: Invalid index" << std::endl;
|
||||
return 0;
|
||||
// If this happens, I have to set some value. I consider this
|
||||
// a configuration error, but I wont exit here.
|
||||
sif::error << "LocalPoolVector: Invalid index. Setting or returning"
|
||||
" last value!" << std::endl;
|
||||
return value[i];
|
||||
}
|
||||
|
||||
template<typename T, uint16_t vectorSize>
|
||||
@ -115,8 +116,11 @@ inline const T& LocalPoolVector<T, vectorSize>::operator [](int i) const {
|
||||
if(i <= vectorSize) {
|
||||
return value[i];
|
||||
}
|
||||
sif::warning << "LocalPoolVector: Invalid index" << std::endl;
|
||||
return 0;
|
||||
// If this happens, I have to set some value. I consider this
|
||||
// a configuration error, but I wont exit here.
|
||||
sif::error << "LocalPoolVector: Invalid index. Setting or returning"
|
||||
" last value!" << std::endl;
|
||||
return value[i];
|
||||
}
|
||||
|
||||
template<typename T, uint16_t vectorSize>
|
||||
|
Loading…
Reference in New Issue
Block a user