2016-06-15 23:48:41 +02:00
|
|
|
#ifndef POOLVARLIST_H_
|
|
|
|
#define POOLVARLIST_H_
|
|
|
|
|
|
|
|
#include <framework/datapool/PoolVariableIF.h>
|
2020-05-17 01:17:11 +02:00
|
|
|
#include <framework/datapoolglob/GlobalPoolVariable.h>
|
2016-06-15 23:48:41 +02:00
|
|
|
template <class T, uint8_t n_var>
|
|
|
|
class PoolVarList {
|
|
|
|
private:
|
2020-05-17 01:17:11 +02:00
|
|
|
GlobPoolVar<T> variables[n_var];
|
2016-06-15 23:48:41 +02:00
|
|
|
public:
|
|
|
|
PoolVarList( const uint32_t set_id[n_var], DataSetIF* dataSet, PoolVariableIF::ReadWriteMode_t setReadWriteMode ) {
|
|
|
|
//I really should have a look at the new init list c++ syntax.
|
|
|
|
if (dataSet == NULL) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
for (uint8_t count = 0; count < n_var; count++) {
|
|
|
|
variables[count].dataPoolId = set_id[count];
|
|
|
|
variables[count].readWriteMode = setReadWriteMode;
|
|
|
|
dataSet->registerVariable(&variables[count]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-05-17 01:17:11 +02:00
|
|
|
GlobPoolVar<T> &operator [](int i) { return variables[i]; }
|
2016-06-15 23:48:41 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif /* POOLVARLIST_H_ */
|