1
0
forked from fsfw/fsfw

DataSetBase not bound to max size anymore

This commit is contained in:
2020-07-02 16:54:53 +02:00
parent 3e069c34aa
commit 099e6281ec
8 changed files with 58 additions and 15 deletions

View File

@ -5,20 +5,30 @@
#include <cmath>
#include <cstring>
LocalDataSet::LocalDataSet(OwnsLocalDataPoolIF *hkOwner): DataSetBase() {
LocalDataSet::LocalDataSet(OwnsLocalDataPoolIF *hkOwner,
const size_t maxNumberOfVariables):
DataSetBase(poolVarList.data(), maxNumberOfVariables) {
poolVarList.reserve(maxNumberOfVariables);
poolVarList.resize(maxNumberOfVariables);
if(hkOwner == nullptr) {
sif::error << "LocalDataSet::LocalDataSet: Owner can't be nullptr!"
<< std::endl;
return;
}
hkManager = hkOwner->getHkManagerHandle();
}
LocalDataSet::LocalDataSet(object_id_t ownerId): DataSetBase() {
LocalDataSet::LocalDataSet(object_id_t ownerId,
const size_t maxNumberOfVariables):
DataSetBase(poolVarList.data(), maxNumberOfVariables) {
poolVarList.reserve(maxNumberOfVariables);
poolVarList.resize(maxNumberOfVariables);
OwnsLocalDataPoolIF* hkOwner = objectManager->get<OwnsLocalDataPoolIF>(
ownerId);
if(hkOwner == nullptr) {
sif::error << "LocalDataSet::LocalDataSet: Owner can't be nullptr!"
<< std::endl;
return;
}
hkManager = hkOwner->getHkManagerHandle();
}

View File

@ -5,6 +5,8 @@
#include <framework/datapoollocal/OwnsLocalDataPoolIF.h>
#include <framework/serialize/SerializeIF.h>
#include <vector>
class LocalDataPoolManager;
/**
@ -35,7 +37,8 @@ public:
* The constructor simply sets the fill_count to zero and sets
* the state to "uninitialized".
*/
LocalDataSet(OwnsLocalDataPoolIF* hkOwner);
LocalDataSet(OwnsLocalDataPoolIF *hkOwner,
const size_t maxNumberOfVariables);
/**
* @brief Constructor for users of local pool data. The passed pool
@ -43,7 +46,8 @@ public:
* The constructor simply sets the fill_count to zero and sets
* the state to "uninitialized".
*/
LocalDataSet(object_id_t ownerId);
LocalDataSet(object_id_t ownerId,
const size_t maxNumberOfVariables);
/**
* @brief The destructor automatically manages writing the valid
@ -102,6 +106,8 @@ private:
* (most significant bit) to 7 (least significant bit)
*/
void bitSetter(uint8_t* byte, uint8_t position) const;
std::vector<PoolVariableIF*> poolVarList;
};
#endif /* FRAMEWORK_DATAPOOLLOCAL_LOCALDATASET_H_ */

View File

@ -0,0 +1,6 @@
#include <framework/datapoollocal/StaticLocalDataSet.h>

View File

@ -0,0 +1,11 @@
#ifndef FRAMEWORK_DATAPOOLLOCAL_STATICLOCALDATASET_H_
#define FRAMEWORK_DATAPOOLLOCAL_STATICLOCALDATASET_H_
#include <framework/datapool/DataSetBase.h>
class StaticLocalDataSet: public DataSetBase {
};
#endif /* FRAMEWORK_DATAPOOLLOCAL_STATICLOCALDATASET_H_ */