datapoollocal updates

This commit is contained in:
Robin Müller 2020-06-06 23:15:05 +02:00
parent ea548dea5b
commit 8216b26fde
4 changed files with 30 additions and 11 deletions

View File

@ -131,11 +131,9 @@ protected:
ReturnValue_t commitWithoutLock() override; ReturnValue_t commitWithoutLock() override;
// std::ostream is the type for object std::cout // std::ostream is the type for object std::cout
// friend std::ostream& operator<< (std::ostream &out, template <typename U>
// const LocalPoolVar &var) { friend std::ostream& operator<< (std::ostream &out,
// out << static_cast<int>(value); const LocalPoolVar<U> &var);
// return out;
// }
private: private:
//! @brief Pool ID of pool entry inside the used local pool. //! @brief Pool ID of pool entry inside the used local pool.

View File

@ -151,11 +151,11 @@ inline ReturnValue_t LocalPoolVar<T>::deSerialize(const uint8_t** buffer,
return AutoSerializeAdapter::deSerialize(&value, buffer, size, bigEndian); return AutoSerializeAdapter::deSerialize(&value, buffer, size, bigEndian);
} }
//template<typename T> template<typename T>
//inline friend std::ostream& LocalPoolVar<T>::operator<< (std::ostream &out, inline std::ostream& operator<< (std::ostream &out,
// const LocalPoolVar &var) { const LocalPoolVar<T> &var) {
// out << static_cast<int>(out); out << var.value;
//} return out;
}
#endif #endif

View File

@ -5,6 +5,7 @@
#include <framework/datapool/PoolEntry.h> #include <framework/datapool/PoolEntry.h>
#include <framework/datapool/PoolVariableIF.h> #include <framework/datapool/PoolVariableIF.h>
#include <framework/serialize/SerializeAdapter.h> #include <framework/serialize/SerializeAdapter.h>
#include <framework/housekeeping/HousekeepingManager.h>
#include <framework/serviceinterface/ServiceInterfaceStream.h> #include <framework/serviceinterface/ServiceInterfaceStream.h>
@ -179,6 +180,11 @@ private:
ReadWriteMode_t readWriteMode; ReadWriteMode_t readWriteMode;
//! @brief Pointer to the class which manages the HK pool. //! @brief Pointer to the class which manages the HK pool.
HousekeepingManager* hkManager; HousekeepingManager* hkManager;
// std::ostream is the type for object std::cout
template <typename U, uint16_t otherSize>
friend std::ostream& operator<< (std::ostream &out,
const LocalPoolVector<U, otherSize> &var);
}; };
#include <framework/datapoollocal/LocalPoolVector.tpp> #include <framework/datapoollocal/LocalPoolVector.tpp>

View File

@ -15,6 +15,7 @@ inline LocalPoolVector<T, vectorSize>::LocalPoolVector(lp_id_t poolId,
"NO_PARAMETER value!" << std::endl; "NO_PARAMETER value!" << std::endl;
} }
memset(this->value, 0, vectorSize * sizeof(T)); memset(this->value, 0, vectorSize * sizeof(T));
hkManager = hkOwner->getHkManagerHandle();
if (dataSet != nullptr) { if (dataSet != nullptr) {
dataSet->registerVariable(this); dataSet->registerVariable(this);
} }
@ -182,4 +183,18 @@ inline bool LocalPoolVector<T, vectorSize>::isValid() const {
return valid; return valid;
} }
template<typename T, uint16_t vectorSize>
inline std::ostream& operator<< (std::ostream &out,
const LocalPoolVector<T, vectorSize> &var) {
out << "Vector: [";
for(int i = 0;i < vectorSize; i++) {
out << var.value[i];
if(i < vectorSize - 1) {
out << ", ";
}
}
out << "]";
return out;
}
#endif #endif