fsfw/datapoollocal/StaticLocalDataSet.h

53 lines
1.7 KiB
C
Raw Normal View History

2020-10-01 12:05:24 +02:00
#ifndef FSFW_DATAPOOLLOCAL_STATICLOCALDATASET_H_
#define FSFW_DATAPOOLLOCAL_STATICLOCALDATASET_H_
#include "LocalPoolDataSetBase.h"
2021-01-27 11:42:24 +01:00
#include "LocalPoolVariable.h"
#include "LocalPoolVector.h"
2020-10-01 12:05:24 +02:00
#include "../objectmanager/SystemObjectIF.h"
#include <array>
/**
2021-01-25 00:55:27 +01:00
* @brief This dataset type can be used to group related pool variables if the number of
* variables is fixed.
2020-10-01 12:05:24 +02:00
* @details
* This will is the primary data structure to organize pool variables into
* sets which can be accessed via the housekeeping service interface or
* which can be sent to other software objects.
*
* It is recommended to read the documentation of the LocalPoolDataSetBase
* class for more information on how this class works and how to use it.
* @tparam capacity Capacity of the static dataset, which is usually known
* beforehand.
*/
template <uint8_t NUM_VARIABLES>
class StaticLocalDataSet: public LocalPoolDataSetBase {
public:
2021-01-13 12:41:24 +01:00
/**
* Constructor used by data owner and creator like device handlers.
* This constructor also initialized the components required for
* periodic handling.
* @param hkOwner
* @param setId
*/
StaticLocalDataSet(HasLocalDataPoolIF* hkOwner, uint32_t setId):
LocalPoolDataSetBase(hkOwner, setId, nullptr, NUM_VARIABLES) {
2020-10-01 12:05:24 +02:00
this->setContainer(poolVarList.data());
}
2021-01-13 12:41:24 +01:00
/**
* Constructor used by data users like controllers.
* @param hkOwner
* @param setId
*/
StaticLocalDataSet(sid_t sid): LocalPoolDataSetBase(sid, nullptr, NUM_VARIABLES) {
2020-10-01 12:05:24 +02:00
this->setContainer(poolVarList.data());
}
private:
std::array<PoolVariableIF*, NUM_VARIABLES> poolVarList;
};
#endif /* FSFW_DATAPOOLLOCAL_STATICLOCALDATASET_H_ */