update afmt scripts to format *.tpp files
All checks were successful
fsfw/fsfw/pipeline/pr-development This commit looks good

This commit is contained in:
Robin Müller 2022-03-29 15:11:41 +02:00
parent bfa77cf810
commit 82fc7f33a8
No known key found for this signature in database
GPG Key ID: 71B58F8A3CDFA9AC
11 changed files with 441 additions and 462 deletions

View File

@ -1,9 +1,9 @@
#include "MgmLIS3MDLHandler.h" #include "MgmLIS3MDLHandler.h"
#include "fsfw/datapool/PoolReadGuard.h"
#include <cmath> #include <cmath>
#include "fsfw/datapool/PoolReadGuard.h"
MgmLIS3MDLHandler::MgmLIS3MDLHandler(object_id_t objectId, object_id_t deviceCommunication, MgmLIS3MDLHandler::MgmLIS3MDLHandler(object_id_t objectId, object_id_t deviceCommunication,
CookieIF *comCookie, uint32_t transitionDelay) CookieIF *comCookie, uint32_t transitionDelay)
: DeviceHandlerBase(objectId, deviceCommunication, comCookie), : DeviceHandlerBase(objectId, deviceCommunication, comCookie),

View File

@ -24,9 +24,7 @@ void UartCookie::setParityEven() { parity = Parity::EVEN; }
Parity UartCookie::getParity() const { return parity; } Parity UartCookie::getParity() const { return parity; }
void UartCookie::setBitsPerWord(BitsPerWord bitsPerWord_) { void UartCookie::setBitsPerWord(BitsPerWord bitsPerWord_) { bitsPerWord = bitsPerWord_; }
bitsPerWord = bitsPerWord_;
}
BitsPerWord UartCookie::getBitsPerWord() const { return bitsPerWord; } BitsPerWord UartCookie::getBitsPerWord() const { return bitsPerWord; }

View File

@ -3,6 +3,6 @@ if [[ ! -f README.md ]]; then
cd .. cd ..
fi fi
find ./src -iname *.h -o -iname *.cpp -o -iname *.c | xargs clang-format --style=file -i find ./src -iname *.h -o -iname *.cpp -o -iname *.c -o -iname *.tpp | xargs clang-format --style=file -i
find ./hal -iname *.h -o -iname *.cpp -o -iname *.c | xargs clang-format --style=file -i find ./hal -iname *.h -o -iname *.cpp -o -iname *.c -o -iname *.tpp | xargs clang-format --style=file -i
find ./tests -iname *.h -o -iname *.cpp -o -iname *.c | xargs clang-format --style=file -i find ./tests -iname *.h -o -iname *.cpp -o -iname *.c -o -iname *.tpp | xargs clang-format --style=file -i

View File

@ -6,8 +6,8 @@
#endif #endif
template <typename T> template <typename T>
inline FIFOBase<T>::FIFOBase(T* values, const size_t maxCapacity): inline FIFOBase<T>::FIFOBase(T* values, const size_t maxCapacity)
maxCapacity(maxCapacity), values(values){}; : maxCapacity(maxCapacity), values(values){};
template <typename T> template <typename T>
inline ReturnValue_t FIFOBase<T>::insert(T value) { inline ReturnValue_t FIFOBase<T>::insert(T value) {
@ -84,7 +84,6 @@ inline size_t FIFOBase<T>::getMaxCapacity() const {
return maxCapacity; return maxCapacity;
} }
template <typename T> template <typename T>
inline void FIFOBase<T>::setContainer(T* data) { inline void FIFOBase<T>::setContainer(T* data) {
this->values = data; this->values = data;

View File

@ -1,9 +1,9 @@
#ifndef FRAMEWORK_CONTAINER_FIXEDORDEREDMULTIMAP_TPP_ #ifndef FRAMEWORK_CONTAINER_FIXEDORDEREDMULTIMAP_TPP_
#define FRAMEWORK_CONTAINER_FIXEDORDEREDMULTIMAP_TPP_ #define FRAMEWORK_CONTAINER_FIXEDORDEREDMULTIMAP_TPP_
template <typename key_t, typename T, typename KEY_COMPARE> template <typename key_t, typename T, typename KEY_COMPARE>
inline ReturnValue_t FixedOrderedMultimap<key_t, T, KEY_COMPARE>::insert(key_t key, T value, Iterator *storedValue) { inline ReturnValue_t FixedOrderedMultimap<key_t, T, KEY_COMPARE>::insert(key_t key, T value,
Iterator *storedValue) {
if (_size == theMap.maxSize()) { if (_size == theMap.maxSize()) {
return MAP_FULL; return MAP_FULL;
} }
@ -71,7 +71,8 @@ inline ReturnValue_t FixedOrderedMultimap<key_t, T, KEY_COMPARE>::find(key_t key
} }
template <typename key_t, typename T, typename KEY_COMPARE> template <typename key_t, typename T, typename KEY_COMPARE>
inline size_t FixedOrderedMultimap<key_t, T, KEY_COMPARE>::findFirstIndex(key_t key, size_t startAt) const { inline size_t FixedOrderedMultimap<key_t, T, KEY_COMPARE>::findFirstIndex(key_t key,
size_t startAt) const {
if (startAt >= _size) { if (startAt >= _size) {
return startAt + 1; return startAt + 1;
} }
@ -105,5 +106,4 @@ inline void FixedOrderedMultimap<key_t, T, KEY_COMPARE>::removeFromPosition(size
--_size; --_size;
} }
#endif /* FRAMEWORK_CONTAINER_FIXEDORDEREDMULTIMAP_TPP_ */ #endif /* FRAMEWORK_CONTAINER_FIXEDORDEREDMULTIMAP_TPP_ */

View File

@ -6,26 +6,24 @@
#endif #endif
template <typename T> template <typename T>
inline LocalPoolVariable<T>::LocalPoolVariable(HasLocalDataPoolIF* hkOwner, inline LocalPoolVariable<T>::LocalPoolVariable(HasLocalDataPoolIF* hkOwner, lp_id_t poolId,
lp_id_t poolId, DataSetIF* dataSet, pool_rwm_t setReadWriteMode): DataSetIF* dataSet, pool_rwm_t setReadWriteMode)
LocalPoolObjectBase(poolId, hkOwner, dataSet, setReadWriteMode) {} : LocalPoolObjectBase(poolId, hkOwner, dataSet, setReadWriteMode) {}
template <typename T> template <typename T>
inline LocalPoolVariable<T>::LocalPoolVariable(object_id_t poolOwner, inline LocalPoolVariable<T>::LocalPoolVariable(object_id_t poolOwner, lp_id_t poolId,
lp_id_t poolId, DataSetIF *dataSet, pool_rwm_t setReadWriteMode): DataSetIF* dataSet, pool_rwm_t setReadWriteMode)
LocalPoolObjectBase(poolOwner, poolId, dataSet, setReadWriteMode) {} : LocalPoolObjectBase(poolOwner, poolId, dataSet, setReadWriteMode) {}
template <typename T> template <typename T>
inline LocalPoolVariable<T>::LocalPoolVariable(gp_id_t globalPoolId, inline LocalPoolVariable<T>::LocalPoolVariable(gp_id_t globalPoolId, DataSetIF* dataSet,
DataSetIF *dataSet, pool_rwm_t setReadWriteMode): pool_rwm_t setReadWriteMode)
LocalPoolObjectBase(globalPoolId.objectId, globalPoolId.localPoolId, : LocalPoolObjectBase(globalPoolId.objectId, globalPoolId.localPoolId, dataSet,
dataSet, setReadWriteMode){} setReadWriteMode) {}
template <typename T> template <typename T>
inline ReturnValue_t LocalPoolVariable<T>::read( inline ReturnValue_t LocalPoolVariable<T>::read(MutexIF::TimeoutType timeoutType,
MutexIF::TimeoutType timeoutType, uint32_t timeoutMs) { uint32_t timeoutMs) {
if (hkManager == nullptr) { if (hkManager == nullptr) {
return readWithoutLock(); return readWithoutLock();
} }
@ -43,19 +41,17 @@ template<typename T>
inline ReturnValue_t LocalPoolVariable<T>::readWithoutLock() { inline ReturnValue_t LocalPoolVariable<T>::readWithoutLock() {
if (readWriteMode == pool_rwm_t::VAR_WRITE) { if (readWriteMode == pool_rwm_t::VAR_WRITE) {
object_id_t targetObjectId = hkManager->getCreatorObjectId(); object_id_t targetObjectId = hkManager->getCreatorObjectId();
reportReadCommitError("LocalPoolVector", reportReadCommitError("LocalPoolVector", PoolVariableIF::INVALID_READ_WRITE_MODE, true,
PoolVariableIF::INVALID_READ_WRITE_MODE, true, targetObjectId, targetObjectId, localPoolId);
localPoolId);
return PoolVariableIF::INVALID_READ_WRITE_MODE; return PoolVariableIF::INVALID_READ_WRITE_MODE;
} }
PoolEntry<T>* poolEntry = nullptr; PoolEntry<T>* poolEntry = nullptr;
ReturnValue_t result = LocalDpManagerAttorney::fetchPoolEntry(*hkManager, localPoolId, ReturnValue_t result =
&poolEntry); LocalDpManagerAttorney::fetchPoolEntry(*hkManager, localPoolId, &poolEntry);
if (result != RETURN_OK) { if (result != RETURN_OK) {
object_id_t ownerObjectId = hkManager->getCreatorObjectId(); object_id_t ownerObjectId = hkManager->getCreatorObjectId();
reportReadCommitError("LocalPoolVariable", result, reportReadCommitError("LocalPoolVariable", result, false, ownerObjectId, localPoolId);
false, ownerObjectId, localPoolId);
return result; return result;
} }
@ -65,15 +61,15 @@ inline ReturnValue_t LocalPoolVariable<T>::readWithoutLock() {
} }
template <typename T> template <typename T>
inline ReturnValue_t LocalPoolVariable<T>::commit(bool setValid, inline ReturnValue_t LocalPoolVariable<T>::commit(bool setValid, MutexIF::TimeoutType timeoutType,
MutexIF::TimeoutType timeoutType, uint32_t timeoutMs) { uint32_t timeoutMs) {
this->setValid(setValid); this->setValid(setValid);
return commit(timeoutType, timeoutMs); return commit(timeoutType, timeoutMs);
} }
template <typename T> template <typename T>
inline ReturnValue_t LocalPoolVariable<T>::commit( inline ReturnValue_t LocalPoolVariable<T>::commit(MutexIF::TimeoutType timeoutType,
MutexIF::TimeoutType timeoutType, uint32_t timeoutMs) { uint32_t timeoutMs) {
if (hkManager == nullptr) { if (hkManager == nullptr) {
return commitWithoutLock(); return commitWithoutLock();
} }
@ -91,19 +87,17 @@ template<typename T>
inline ReturnValue_t LocalPoolVariable<T>::commitWithoutLock() { inline ReturnValue_t LocalPoolVariable<T>::commitWithoutLock() {
if (readWriteMode == pool_rwm_t::VAR_READ) { if (readWriteMode == pool_rwm_t::VAR_READ) {
object_id_t targetObjectId = hkManager->getCreatorObjectId(); object_id_t targetObjectId = hkManager->getCreatorObjectId();
reportReadCommitError("LocalPoolVector", reportReadCommitError("LocalPoolVector", PoolVariableIF::INVALID_READ_WRITE_MODE, false,
PoolVariableIF::INVALID_READ_WRITE_MODE, false, targetObjectId, targetObjectId, localPoolId);
localPoolId);
return PoolVariableIF::INVALID_READ_WRITE_MODE; return PoolVariableIF::INVALID_READ_WRITE_MODE;
} }
PoolEntry<T>* poolEntry = nullptr; PoolEntry<T>* poolEntry = nullptr;
ReturnValue_t result = LocalDpManagerAttorney::fetchPoolEntry(*hkManager, localPoolId, ReturnValue_t result =
&poolEntry); LocalDpManagerAttorney::fetchPoolEntry(*hkManager, localPoolId, &poolEntry);
if (result != RETURN_OK) { if (result != RETURN_OK) {
object_id_t ownerObjectId = hkManager->getCreatorObjectId(); object_id_t ownerObjectId = hkManager->getCreatorObjectId();
reportReadCommitError("LocalPoolVariable", result, reportReadCommitError("LocalPoolVariable", result, false, ownerObjectId, localPoolId);
false, ownerObjectId, localPoolId);
return result; return result;
} }
@ -113,11 +107,10 @@ inline ReturnValue_t LocalPoolVariable<T>::commitWithoutLock() {
} }
template <typename T> template <typename T>
inline ReturnValue_t LocalPoolVariable<T>::serialize(uint8_t** buffer, inline ReturnValue_t LocalPoolVariable<T>::serialize(
size_t* size, const size_t max_size, uint8_t** buffer, size_t* size, const size_t max_size,
SerializeIF::Endianness streamEndianness) const { SerializeIF::Endianness streamEndianness) const {
return SerializeAdapter::serialize(&value, return SerializeAdapter::serialize(&value, buffer, size, max_size, streamEndianness);
buffer, size ,max_size, streamEndianness);
} }
template <typename T> template <typename T>
@ -126,15 +119,14 @@ inline size_t LocalPoolVariable<T>::getSerializedSize() const {
} }
template <typename T> template <typename T>
inline ReturnValue_t LocalPoolVariable<T>::deSerialize(const uint8_t** buffer, inline ReturnValue_t LocalPoolVariable<T>::deSerialize(const uint8_t** buffer, size_t* size,
size_t* size, SerializeIF::Endianness streamEndianness) { SerializeIF::Endianness streamEndianness) {
return SerializeAdapter::deSerialize(&value, buffer, size, streamEndianness); return SerializeAdapter::deSerialize(&value, buffer, size, streamEndianness);
} }
#if FSFW_CPP_OSTREAM_ENABLED == 1 #if FSFW_CPP_OSTREAM_ENABLED == 1
template <typename T> template <typename T>
inline std::ostream& operator<< (std::ostream &out, inline std::ostream& operator<<(std::ostream& out, const LocalPoolVariable<T>& var) {
const LocalPoolVariable<T> &var) {
out << var.value; out << var.value;
return out; return out;
} }
@ -146,8 +138,7 @@ inline LocalPoolVariable<T>::operator T() const {
} }
template <typename T> template <typename T>
inline LocalPoolVariable<T> & LocalPoolVariable<T>::operator=( inline LocalPoolVariable<T>& LocalPoolVariable<T>::operator=(const T& newValue) {
const T& newValue) {
value = newValue; value = newValue;
return *this; return *this;
} }
@ -160,8 +151,7 @@ inline LocalPoolVariable<T>& LocalPoolVariable<T>::operator =(
} }
template <typename T> template <typename T>
inline bool LocalPoolVariable<T>::operator ==( inline bool LocalPoolVariable<T>::operator==(const LocalPoolVariable<T>& other) const {
const LocalPoolVariable<T> &other) const {
return this->value == other.value; return this->value == other.value;
} }
@ -170,10 +160,8 @@ inline bool LocalPoolVariable<T>::operator ==(const T &other) const {
return this->value == other; return this->value == other;
} }
template <typename T> template <typename T>
inline bool LocalPoolVariable<T>::operator !=( inline bool LocalPoolVariable<T>::operator!=(const LocalPoolVariable<T>& other) const {
const LocalPoolVariable<T> &other) const {
return not(*this == other); return not(*this == other);
} }
@ -182,10 +170,8 @@ inline bool LocalPoolVariable<T>::operator !=(const T &other) const {
return not(*this == other); return not(*this == other);
} }
template <typename T> template <typename T>
inline bool LocalPoolVariable<T>::operator <( inline bool LocalPoolVariable<T>::operator<(const LocalPoolVariable<T>& other) const {
const LocalPoolVariable<T> &other) const {
return this->value < other.value; return this->value < other.value;
} }
@ -194,10 +180,8 @@ inline bool LocalPoolVariable<T>::operator <(const T &other) const {
return this->value < other; return this->value < other;
} }
template <typename T> template <typename T>
inline bool LocalPoolVariable<T>::operator >( inline bool LocalPoolVariable<T>::operator>(const LocalPoolVariable<T>& other) const {
const LocalPoolVariable<T> &other) const {
return not(*this < other); return not(*this < other);
} }

View File

@ -6,25 +6,26 @@
#endif #endif
template <typename T, uint16_t vectorSize> template <typename T, uint16_t vectorSize>
inline LocalPoolVector<T, vectorSize>::LocalPoolVector( inline LocalPoolVector<T, vectorSize>::LocalPoolVector(HasLocalDataPoolIF* hkOwner, lp_id_t poolId,
HasLocalDataPoolIF* hkOwner, lp_id_t poolId, DataSetIF* dataSet, DataSetIF* dataSet,
pool_rwm_t setReadWriteMode): pool_rwm_t setReadWriteMode)
LocalPoolObjectBase(poolId, hkOwner, dataSet, setReadWriteMode) {} : LocalPoolObjectBase(poolId, hkOwner, dataSet, setReadWriteMode) {}
template <typename T, uint16_t vectorSize> template <typename T, uint16_t vectorSize>
inline LocalPoolVector<T, vectorSize>::LocalPoolVector(object_id_t poolOwner, inline LocalPoolVector<T, vectorSize>::LocalPoolVector(object_id_t poolOwner, lp_id_t poolId,
lp_id_t poolId, DataSetIF *dataSet, pool_rwm_t setReadWriteMode): DataSetIF* dataSet,
LocalPoolObjectBase(poolOwner, poolId, dataSet, setReadWriteMode) {} pool_rwm_t setReadWriteMode)
: LocalPoolObjectBase(poolOwner, poolId, dataSet, setReadWriteMode) {}
template <typename T, uint16_t vectorSize> template <typename T, uint16_t vectorSize>
inline LocalPoolVector<T, vectorSize>::LocalPoolVector(gp_id_t globalPoolId, inline LocalPoolVector<T, vectorSize>::LocalPoolVector(gp_id_t globalPoolId, DataSetIF* dataSet,
DataSetIF *dataSet, pool_rwm_t setReadWriteMode): pool_rwm_t setReadWriteMode)
LocalPoolObjectBase(globalPoolId.objectId, globalPoolId.localPoolId, : LocalPoolObjectBase(globalPoolId.objectId, globalPoolId.localPoolId, dataSet,
dataSet, setReadWriteMode) {} setReadWriteMode) {}
template <typename T, uint16_t vectorSize> template <typename T, uint16_t vectorSize>
inline ReturnValue_t LocalPoolVector<T, vectorSize>::read( inline ReturnValue_t LocalPoolVector<T, vectorSize>::read(MutexIF::TimeoutType timeoutType,
MutexIF::TimeoutType timeoutType, uint32_t timeoutMs) { uint32_t timeoutMs) {
MutexGuard(LocalDpManagerAttorney::getMutexHandle(*hkManager), timeoutType, timeoutMs); MutexGuard(LocalDpManagerAttorney::getMutexHandle(*hkManager), timeoutType, timeoutMs);
return readWithoutLock(); return readWithoutLock();
} }
@ -32,21 +33,19 @@ template<typename T, uint16_t vectorSize>
inline ReturnValue_t LocalPoolVector<T, vectorSize>::readWithoutLock() { inline ReturnValue_t LocalPoolVector<T, vectorSize>::readWithoutLock() {
if (readWriteMode == pool_rwm_t::VAR_WRITE) { if (readWriteMode == pool_rwm_t::VAR_WRITE) {
object_id_t targetObjectId = hkManager->getCreatorObjectId(); object_id_t targetObjectId = hkManager->getCreatorObjectId();
reportReadCommitError("LocalPoolVector", reportReadCommitError("LocalPoolVector", PoolVariableIF::INVALID_READ_WRITE_MODE, true,
PoolVariableIF::INVALID_READ_WRITE_MODE, true, targetObjectId, targetObjectId, localPoolId);
localPoolId);
return PoolVariableIF::INVALID_READ_WRITE_MODE; return PoolVariableIF::INVALID_READ_WRITE_MODE;
} }
PoolEntry<T>* poolEntry = nullptr; PoolEntry<T>* poolEntry = nullptr;
ReturnValue_t result = LocalDpManagerAttorney::fetchPoolEntry(*hkManager, localPoolId, ReturnValue_t result =
&poolEntry); LocalDpManagerAttorney::fetchPoolEntry(*hkManager, localPoolId, &poolEntry);
memset(this->value, 0, vectorSize * sizeof(T)); memset(this->value, 0, vectorSize * sizeof(T));
if (result != RETURN_OK) { if (result != RETURN_OK) {
object_id_t targetObjectId = hkManager->getCreatorObjectId(); object_id_t targetObjectId = hkManager->getCreatorObjectId();
reportReadCommitError("LocalPoolVector", result, true, targetObjectId, reportReadCommitError("LocalPoolVector", result, true, targetObjectId, localPoolId);
localPoolId);
return result; return result;
} }
std::memcpy(this->value, poolEntry->getDataPtr(), poolEntry->getByteSize()); std::memcpy(this->value, poolEntry->getDataPtr(), poolEntry->getByteSize());
@ -56,14 +55,15 @@ inline ReturnValue_t LocalPoolVector<T, vectorSize>::readWithoutLock() {
template <typename T, uint16_t vectorSize> template <typename T, uint16_t vectorSize>
inline ReturnValue_t LocalPoolVector<T, vectorSize>::commit(bool valid, inline ReturnValue_t LocalPoolVector<T, vectorSize>::commit(bool valid,
MutexIF::TimeoutType timeoutType, uint32_t timeoutMs) { MutexIF::TimeoutType timeoutType,
uint32_t timeoutMs) {
this->setValid(valid); this->setValid(valid);
return commit(timeoutType, timeoutMs); return commit(timeoutType, timeoutMs);
} }
template <typename T, uint16_t vectorSize> template <typename T, uint16_t vectorSize>
inline ReturnValue_t LocalPoolVector<T, vectorSize>::commit( inline ReturnValue_t LocalPoolVector<T, vectorSize>::commit(MutexIF::TimeoutType timeoutType,
MutexIF::TimeoutType timeoutType, uint32_t timeoutMs) { uint32_t timeoutMs) {
MutexGuard(LocalDpManagerAttorney::getMutexHandle(*hkManager), timeoutType, timeoutMs); MutexGuard(LocalDpManagerAttorney::getMutexHandle(*hkManager), timeoutType, timeoutMs);
return commitWithoutLock(); return commitWithoutLock();
} }
@ -72,18 +72,16 @@ template<typename T, uint16_t vectorSize>
inline ReturnValue_t LocalPoolVector<T, vectorSize>::commitWithoutLock() { inline ReturnValue_t LocalPoolVector<T, vectorSize>::commitWithoutLock() {
if (readWriteMode == pool_rwm_t::VAR_READ) { if (readWriteMode == pool_rwm_t::VAR_READ) {
object_id_t targetObjectId = hkManager->getCreatorObjectId(); object_id_t targetObjectId = hkManager->getCreatorObjectId();
reportReadCommitError("LocalPoolVector", reportReadCommitError("LocalPoolVector", PoolVariableIF::INVALID_READ_WRITE_MODE, false,
PoolVariableIF::INVALID_READ_WRITE_MODE, false, targetObjectId, targetObjectId, localPoolId);
localPoolId);
return PoolVariableIF::INVALID_READ_WRITE_MODE; return PoolVariableIF::INVALID_READ_WRITE_MODE;
} }
PoolEntry<T>* poolEntry = nullptr; PoolEntry<T>* poolEntry = nullptr;
ReturnValue_t result = LocalDpManagerAttorney::fetchPoolEntry(*hkManager, localPoolId, ReturnValue_t result =
&poolEntry); LocalDpManagerAttorney::fetchPoolEntry(*hkManager, localPoolId, &poolEntry);
if (result != RETURN_OK) { if (result != RETURN_OK) {
object_id_t targetObjectId = hkManager->getCreatorObjectId(); object_id_t targetObjectId = hkManager->getCreatorObjectId();
reportReadCommitError("LocalPoolVector", result, false, targetObjectId, reportReadCommitError("LocalPoolVector", result, false, targetObjectId, localPoolId);
localPoolId);
return result; return result;
} }
std::memcpy(poolEntry->getDataPtr(), this->value, poolEntry->getByteSize()); std::memcpy(poolEntry->getDataPtr(), this->value, poolEntry->getByteSize());
@ -100,9 +98,11 @@ inline T& LocalPoolVector<T, vectorSize>::operator [](size_t i) {
// a configuration error, but I wont exit here. // a configuration error, but I wont exit here.
#if FSFW_CPP_OSTREAM_ENABLED == 1 #if FSFW_CPP_OSTREAM_ENABLED == 1
sif::warning << "LocalPoolVector: Invalid index. Setting or returning" sif::warning << "LocalPoolVector: Invalid index. Setting or returning"
" last value!" << std::endl; " last value!"
<< std::endl;
#else #else
sif::printWarning("LocalPoolVector: Invalid index. Setting or returning" sif::printWarning(
"LocalPoolVector: Invalid index. Setting or returning"
" last value!\n"); " last value!\n");
#endif #endif
return value[vectorSize - 1]; return value[vectorSize - 1];
@ -117,22 +117,23 @@ inline const T& LocalPoolVector<T, vectorSize>::operator [](size_t i) const {
// a configuration error, but I wont exit here. // a configuration error, but I wont exit here.
#if FSFW_CPP_OSTREAM_ENABLED == 1 #if FSFW_CPP_OSTREAM_ENABLED == 1
sif::warning << "LocalPoolVector: Invalid index. Setting or returning" sif::warning << "LocalPoolVector: Invalid index. Setting or returning"
" last value!" << std::endl; " last value!"
<< std::endl;
#else #else
sif::printWarning("LocalPoolVector: Invalid index. Setting or returning" sif::printWarning(
"LocalPoolVector: Invalid index. Setting or returning"
" last value!\n"); " last value!\n");
#endif #endif
return value[vectorSize - 1]; return value[vectorSize - 1];
} }
template <typename T, uint16_t vectorSize> template <typename T, uint16_t vectorSize>
inline ReturnValue_t LocalPoolVector<T, vectorSize>::serialize(uint8_t** buffer, inline ReturnValue_t LocalPoolVector<T, vectorSize>::serialize(
size_t* size, size_t maxSize, uint8_t** buffer, size_t* size, size_t maxSize,
SerializeIF::Endianness streamEndianness) const { SerializeIF::Endianness streamEndianness) const {
ReturnValue_t result = HasReturnvaluesIF::RETURN_FAILED; ReturnValue_t result = HasReturnvaluesIF::RETURN_FAILED;
for (uint16_t i = 0; i < vectorSize; i++) { for (uint16_t i = 0; i < vectorSize; i++) {
result = SerializeAdapter::serialize(&(value[i]), buffer, size, result = SerializeAdapter::serialize(&(value[i]), buffer, size, maxSize, streamEndianness);
maxSize, streamEndianness);
if (result != HasReturnvaluesIF::RETURN_OK) { if (result != HasReturnvaluesIF::RETURN_OK) {
break; break;
} }
@ -147,12 +148,10 @@ inline size_t LocalPoolVector<T, vectorSize>::getSerializedSize() const {
template <typename T, uint16_t vectorSize> template <typename T, uint16_t vectorSize>
inline ReturnValue_t LocalPoolVector<T, vectorSize>::deSerialize( inline ReturnValue_t LocalPoolVector<T, vectorSize>::deSerialize(
const uint8_t** buffer, size_t* size, const uint8_t** buffer, size_t* size, SerializeIF::Endianness streamEndianness) {
SerializeIF::Endianness streamEndianness) {
ReturnValue_t result = HasReturnvaluesIF::RETURN_FAILED; ReturnValue_t result = HasReturnvaluesIF::RETURN_FAILED;
for (uint16_t i = 0; i < vectorSize; i++) { for (uint16_t i = 0; i < vectorSize; i++) {
result = SerializeAdapter::deSerialize(&(value[i]), buffer, size, result = SerializeAdapter::deSerialize(&(value[i]), buffer, size, streamEndianness);
streamEndianness);
if (result != HasReturnvaluesIF::RETURN_OK) { if (result != HasReturnvaluesIF::RETURN_OK) {
break; break;
} }
@ -162,8 +161,7 @@ inline ReturnValue_t LocalPoolVector<T, vectorSize>::deSerialize(
#if FSFW_CPP_OSTREAM_ENABLED == 1 #if FSFW_CPP_OSTREAM_ENABLED == 1
template <typename T, uint16_t vectorSize> template <typename T, uint16_t vectorSize>
inline std::ostream& operator<< (std::ostream &out, inline std::ostream& operator<<(std::ostream& out, const LocalPoolVector<T, vectorSize>& var) {
const LocalPoolVector<T, vectorSize> &var) {
out << "Vector: ["; out << "Vector: [";
for (int i = 0; i < vectorSize; i++) { for (int i = 0; i < vectorSize; i++) {
out << var.value[i]; out << var.value[i];

View File

@ -67,7 +67,6 @@ class PeriodicTask : public RTEMSTaskBase, public PeriodicTaskIF {
*/ */
ReturnValue_t addComponent(ExecutableObjectIF *object) override; ReturnValue_t addComponent(ExecutableObjectIF *object) override;
uint32_t getPeriodMs() const override; uint32_t getPeriodMs() const override;
ReturnValue_t sleepFor(uint32_t ms) override; ReturnValue_t sleepFor(uint32_t ms) override;

View File

@ -1,8 +1,9 @@
#include "version.h" #include "version.h"
#include "fsfw/FSFWVersion.h"
#include <cstdio> #include <cstdio>
#include "fsfw/FSFWVersion.h"
#ifdef major #ifdef major
#undef major #undef major
#endif #endif