renaming complete, pool in namespace

This commit is contained in:
Robin Müller 2020-05-17 13:37:50 +02:00
parent cbfa21d45a
commit 5b8a6e35dc
15 changed files with 37 additions and 31 deletions

View File

@ -17,7 +17,7 @@ protected:
uint8_t valid; uint8_t valid;
ReturnValue_t read() { ReturnValue_t read() {
uint8_t arrayIndex = GlobalDataPool::PIDToArrayIndex(parameterId); uint8_t arrayIndex = GlobalDataPool::PIDToArrayIndex(parameterId);
PoolEntry<T>* read_out = ::dataPool.getData<T>( PoolEntry<T>* read_out = glob::dataPool.getData<T>(
GlobalDataPool::PIDToDataPoolId(parameterId), arrayIndex); GlobalDataPool::PIDToDataPoolId(parameterId), arrayIndex);
if (read_out != NULL) { if (read_out != NULL) {
valid = read_out->valid; valid = read_out->valid;

View File

@ -19,7 +19,7 @@ PoolRawAccess::~PoolRawAccess() {
} }
ReturnValue_t PoolRawAccess::read() { ReturnValue_t PoolRawAccess::read() {
PoolEntryIF* read_out = ::dataPool.getRawData(dataPoolId); PoolEntryIF* read_out = glob::dataPool.getRawData(dataPoolId);
if (read_out != NULL) { if (read_out != NULL) {
valid = read_out->getValid(); valid = read_out->getValid();
if (read_out->getSize() > arrayEntry) { if (read_out->getSize() > arrayEntry) {
@ -52,7 +52,7 @@ ReturnValue_t PoolRawAccess::read() {
} }
ReturnValue_t PoolRawAccess::commit() { ReturnValue_t PoolRawAccess::commit() {
PoolEntryIF* write_back = ::dataPool.getRawData(dataPoolId); PoolEntryIF* write_back = glob::dataPool.getRawData(dataPoolId);
if ((write_back != NULL) && (readWriteMode != VAR_READ)) { if ((write_back != NULL) && (readWriteMode != VAR_READ)) {
write_back->setValid(valid); write_back->setValid(valid);
uint8_t array_position = arrayEntry * typeSize; uint8_t array_position = arrayEntry * typeSize;

View File

@ -38,7 +38,7 @@ ReturnValue_t DataPoolAdmin::executeAction(ActionId_t actionId,
uint8_t valid = data[4]; uint8_t valid = data[4];
uint32_t poolId = ::dataPool.PIDToDataPoolId(address); uint32_t poolId = glob::dataPool.PIDToDataPoolId(address);
GlobDataSet mySet; GlobDataSet mySet;
PoolRawAccess variable(poolId, 0, &mySet, PoolVariableIF::VAR_READ_WRITE); PoolRawAccess variable(poolId, 0, &mySet, PoolVariableIF::VAR_READ_WRITE);
@ -90,8 +90,8 @@ void DataPoolAdmin::handleCommand() {
ReturnValue_t DataPoolAdmin::handleMemoryLoad(uint32_t address, ReturnValue_t DataPoolAdmin::handleMemoryLoad(uint32_t address,
const uint8_t* data, uint32_t size, uint8_t** dataPointer) { const uint8_t* data, uint32_t size, uint8_t** dataPointer) {
uint32_t poolId = ::dataPool.PIDToDataPoolId(address); uint32_t poolId = glob::dataPool.PIDToDataPoolId(address);
uint8_t arrayIndex = ::dataPool.PIDToArrayIndex(address); uint8_t arrayIndex = glob::dataPool.PIDToArrayIndex(address);
GlobDataSet testSet; GlobDataSet testSet;
PoolRawAccess varToGetSize(poolId, arrayIndex, &testSet, PoolRawAccess varToGetSize(poolId, arrayIndex, &testSet,
PoolVariableIF::VAR_READ); PoolVariableIF::VAR_READ);
@ -129,8 +129,8 @@ ReturnValue_t DataPoolAdmin::handleMemoryLoad(uint32_t address,
ReturnValue_t DataPoolAdmin::handleMemoryDump(uint32_t address, uint32_t size, ReturnValue_t DataPoolAdmin::handleMemoryDump(uint32_t address, uint32_t size,
uint8_t** dataPointer, uint8_t* copyHere) { uint8_t** dataPointer, uint8_t* copyHere) {
uint32_t poolId = ::dataPool.PIDToDataPoolId(address); uint32_t poolId = glob::dataPool.PIDToDataPoolId(address);
uint8_t arrayIndex = ::dataPool.PIDToArrayIndex(address); uint8_t arrayIndex = glob::dataPool.PIDToArrayIndex(address);
GlobDataSet testSet; GlobDataSet testSet;
PoolRawAccess varToGetSize(poolId, arrayIndex, &testSet, PoolRawAccess varToGetSize(poolId, arrayIndex, &testSet,
PoolVariableIF::VAR_READ); PoolVariableIF::VAR_READ);

View File

@ -142,5 +142,8 @@ public:
}; };
//We assume someone globally instantiates a DataPool. //We assume someone globally instantiates a DataPool.
namespace glob {
extern GlobalDataPool dataPool; extern GlobalDataPool dataPool;
}
#endif /* DATAPOOL_H_ */ #endif /* DATAPOOL_H_ */

View File

@ -111,11 +111,11 @@ ReturnValue_t GlobDataSet::handleUnreadDatasetCommit() {
} }
ReturnValue_t GlobDataSet::unlockDataPool() { ReturnValue_t GlobDataSet::unlockDataPool() {
return ::dataPool.freeDataPoolLock(); return glob::dataPool.freeDataPoolLock();
} }
ReturnValue_t GlobDataSet::lockDataPool() { ReturnValue_t GlobDataSet::lockDataPool() {
return ::dataPool.lockDataPool(); return glob::dataPool.lockDataPool();
} }
ReturnValue_t GlobDataSet::serialize(uint8_t** buffer, size_t* size, ReturnValue_t GlobDataSet::serialize(uint8_t** buffer, size_t* size,

View File

@ -13,7 +13,7 @@ inline GlobPoolVar<T>::GlobPoolVar(uint32_t set_id,
template <class T> template <class T>
inline ReturnValue_t GlobPoolVar<T>::read() { inline ReturnValue_t GlobPoolVar<T>::read() {
PoolEntry<T>* read_out = ::dataPool.getData<T>(dataPoolId, 1); PoolEntry<T>* read_out = glob::dataPool.getData<T>(dataPoolId, 1);
if (read_out != NULL) { if (read_out != NULL) {
valid = read_out->valid; valid = read_out->valid;
value = *(read_out->address); value = *(read_out->address);
@ -29,7 +29,7 @@ inline ReturnValue_t GlobPoolVar<T>::read() {
template <class T> template <class T>
inline ReturnValue_t GlobPoolVar<T>::commit() { inline ReturnValue_t GlobPoolVar<T>::commit() {
PoolEntry<T>* write_back = ::dataPool.getData<T>(dataPoolId, 1); PoolEntry<T>* write_back = glob::dataPool.getData<T>(dataPoolId, 1);
if ((write_back != NULL) && (readWriteMode != VAR_READ)) { if ((write_back != NULL) && (readWriteMode != VAR_READ)) {
write_back->valid = valid; write_back->valid = valid;
*(write_back->address) = value; *(write_back->address) = value;

View File

@ -50,7 +50,7 @@ protected:
* The operation does NOT provide any mutual exclusive protection by itself. * The operation does NOT provide any mutual exclusive protection by itself.
*/ */
ReturnValue_t read() { ReturnValue_t read() {
PoolEntry<T>* read_out = ::dataPool.getData<T>(this->dataPoolId, PoolEntry<T>* read_out = glob::dataPool.getData<T>(this->dataPoolId,
vector_size); vector_size);
if (read_out != NULL) { if (read_out != NULL) {
this->valid = read_out->valid; this->valid = read_out->valid;
@ -74,7 +74,7 @@ protected:
* *
*/ */
ReturnValue_t commit() { ReturnValue_t commit() {
PoolEntry<T>* write_back = ::dataPool.getData<T>(this->dataPoolId, PoolEntry<T>* write_back = glob::dataPool.getData<T>(this->dataPoolId,
vector_size); vector_size);
if ((write_back != NULL) && (this->readWriteMode != VAR_READ)) { if ((write_back != NULL) && (this->readWriteMode != VAR_READ)) {
write_back->valid = valid; write_back->valid = valid;

View File

@ -1141,7 +1141,7 @@ void DeviceHandlerBase::handleDeviceTM(SerializeIF* data,
} }
ReturnValue_t DeviceHandlerBase::executeAction(ActionId_t actionId, ReturnValue_t DeviceHandlerBase::executeAction(ActionId_t actionId,
MessageQueueId_t commandedBy, const uint8_t* data, uint32_t size) { MessageQueueId_t commandedBy, const uint8_t* data, size_t size) {
ReturnValue_t result = acceptExternalDeviceCommands(); ReturnValue_t result = acceptExternalDeviceCommands();
if (result != HasReturnvaluesIF::RETURN_OK) { if (result != HasReturnvaluesIF::RETURN_OK) {
return result; return result;

View File

@ -482,7 +482,8 @@ public:
virtual void setParentQueue(MessageQueueId_t parentQueueId); virtual void setParentQueue(MessageQueueId_t parentQueueId);
ReturnValue_t executeAction(ActionId_t actionId, ReturnValue_t executeAction(ActionId_t actionId,
MessageQueueId_t commandedBy, const uint8_t* data, uint32_t size); MessageQueueId_t commandedBy, const uint8_t* data,
size_t size) override;
Mode_t getTransitionSourceMode() const; Mode_t getTransitionSourceMode() const;
Submode_t getTransitionSourceSubMode() const; Submode_t getTransitionSourceSubMode() const;
virtual void getMode(Mode_t *mode, Submode_t *submode); virtual void getMode(Mode_t *mode, Submode_t *submode);

View File

@ -8,6 +8,8 @@ CXXSRC += $(wildcard $(FRAMEWORK_PATH)/controller/*.cpp)
CXXSRC += $(wildcard $(FRAMEWORK_PATH)/coordinates/*.cpp) CXXSRC += $(wildcard $(FRAMEWORK_PATH)/coordinates/*.cpp)
CXXSRC += $(wildcard $(FRAMEWORK_PATH)/datalinklayer/*.cpp) CXXSRC += $(wildcard $(FRAMEWORK_PATH)/datalinklayer/*.cpp)
CXXSRC += $(wildcard $(FRAMEWORK_PATH)/datapool/*.cpp) CXXSRC += $(wildcard $(FRAMEWORK_PATH)/datapool/*.cpp)
CXXSRC += $(wildcard $(FRAMEWORK_PATH)/datapoolglob/*.cpp)
CXXSRC += $(wildcard $(FRAMEWORK_PATH)/datapoollocal/*.cpp)
CXXSRC += $(wildcard $(FRAMEWORK_PATH)/devicehandlers/*.cpp) CXXSRC += $(wildcard $(FRAMEWORK_PATH)/devicehandlers/*.cpp)
CXXSRC += $(wildcard $(FRAMEWORK_PATH)/events/*.cpp) CXXSRC += $(wildcard $(FRAMEWORK_PATH)/events/*.cpp)
CXXSRC += $(wildcard $(FRAMEWORK_PATH)/events/eventmatching/*.cpp) CXXSRC += $(wildcard $(FRAMEWORK_PATH)/events/eventmatching/*.cpp)

View File

@ -2,7 +2,7 @@
#define TEMPERATURESENSOR_H_ #define TEMPERATURESENSOR_H_
#include <framework/thermal/AbstractTemperatureSensor.h> #include <framework/thermal/AbstractTemperatureSensor.h>
#include <framework/datapool/DataSet.h> #include <framework/datapoolglob/GlobalDataSet.h>
#include <framework/monitoring/LimitMonitor.h> #include <framework/monitoring/LimitMonitor.h>
/** /**
@ -68,12 +68,12 @@ public:
TemperatureSensor(object_id_t setObjectid, TemperatureSensor(object_id_t setObjectid,
inputType *inputValue, PoolVariableIF *poolVariable, inputType *inputValue, PoolVariableIF *poolVariable,
uint8_t vectorIndex, uint32_t datapoolId, Parameters parameters = {0, 0, 0, 0, 0, 0}, uint8_t vectorIndex, uint32_t datapoolId, Parameters parameters = {0, 0, 0, 0, 0, 0},
DataSet *outputSet = NULL, ThermalModuleIF *thermalModule = NULL) : GlobDataSet *outputSet = NULL, ThermalModuleIF *thermalModule = NULL) :
AbstractTemperatureSensor(setObjectid, thermalModule), parameters(parameters), AbstractTemperatureSensor(setObjectid, thermalModule), parameters(parameters),
inputValue(inputValue), poolVariable(poolVariable), inputValue(inputValue), poolVariable(poolVariable),
outputTemperature(datapoolId, outputSet, PoolVariableIF::VAR_WRITE), outputTemperature(datapoolId, outputSet, PoolVariableIF::VAR_WRITE),
sensorMonitor(setObjectid, DOMAIN_ID_SENSOR, sensorMonitor(setObjectid, DOMAIN_ID_SENSOR,
DataPool::poolIdAndPositionToPid(poolVariable->getDataPoolId(), vectorIndex), GlobalDataPool::poolIdAndPositionToPid(poolVariable->getDataPoolId(), vectorIndex),
DEFAULT_CONFIRMATION_COUNT, parameters.lowerLimit, parameters.upperLimit, DEFAULT_CONFIRMATION_COUNT, parameters.lowerLimit, parameters.upperLimit,
TEMP_SENSOR_LOW, TEMP_SENSOR_HIGH), TEMP_SENSOR_LOW, TEMP_SENSOR_HIGH),
oldTemperature(20), uptimeOfOldTemperature( { INVALID_TEMPERATURE, 0 }) { oldTemperature(20), uptimeOfOldTemperature( { INVALID_TEMPERATURE, 0 }) {
@ -111,7 +111,7 @@ protected:
PoolVariableIF *poolVariable; PoolVariableIF *poolVariable;
PoolVariable<float> outputTemperature; gp_float_t outputTemperature;
LimitMonitor<limitType> sensorMonitor; LimitMonitor<limitType> sensorMonitor;

View File

@ -3,7 +3,7 @@
ThermalComponent::ThermalComponent(object_id_t reportingObjectId, ThermalComponent::ThermalComponent(object_id_t reportingObjectId,
uint8_t domainId, uint32_t temperaturePoolId, uint8_t domainId, uint32_t temperaturePoolId,
uint32_t targetStatePoolId, uint32_t currentStatePoolId, uint32_t targetStatePoolId, uint32_t currentStatePoolId,
uint32_t requestPoolId, DataSet* dataSet, uint32_t requestPoolId, GlobDataSet* dataSet,
AbstractTemperatureSensor* sensor, AbstractTemperatureSensor* sensor,
AbstractTemperatureSensor* firstRedundantSensor, AbstractTemperatureSensor* firstRedundantSensor,
AbstractTemperatureSensor* secondRedundantSensor, AbstractTemperatureSensor* secondRedundantSensor,
@ -22,8 +22,8 @@ ThermalComponent::~ThermalComponent() {
} }
ReturnValue_t ThermalComponent::setTargetState(int8_t newState) { ReturnValue_t ThermalComponent::setTargetState(int8_t newState) {
DataSet mySet; GlobDataSet mySet;
PoolVariable<int8_t> writableTargetState(targetState.getDataPoolId(), gp_int8_t writableTargetState(targetState.getDataPoolId(),
&mySet, PoolVariableIF::VAR_READ_WRITE); &mySet, PoolVariableIF::VAR_READ_WRITE);
mySet.read(); mySet.read();
if ((writableTargetState == STATE_REQUEST_OPERATIONAL) if ((writableTargetState == STATE_REQUEST_OPERATIONAL)

View File

@ -44,7 +44,7 @@ public:
*/ */
ThermalComponent(object_id_t reportingObjectId, uint8_t domainId, uint32_t temperaturePoolId, ThermalComponent(object_id_t reportingObjectId, uint8_t domainId, uint32_t temperaturePoolId,
uint32_t targetStatePoolId, uint32_t currentStatePoolId, uint32_t requestPoolId, uint32_t targetStatePoolId, uint32_t currentStatePoolId, uint32_t requestPoolId,
DataSet *dataSet, AbstractTemperatureSensor *sensor, GlobDataSet *dataSet, AbstractTemperatureSensor *sensor,
AbstractTemperatureSensor *firstRedundantSensor, AbstractTemperatureSensor *firstRedundantSensor,
AbstractTemperatureSensor *secondRedundantSensor, AbstractTemperatureSensor *secondRedundantSensor,
ThermalModuleIF *thermalModule, Parameters parameters, ThermalModuleIF *thermalModule, Parameters parameters,

View File

@ -6,7 +6,7 @@
ThermalModule::ThermalModule(uint32_t moduleTemperaturePoolId, ThermalModule::ThermalModule(uint32_t moduleTemperaturePoolId,
uint32_t currentStatePoolId, uint32_t targetStatePoolId, uint32_t currentStatePoolId, uint32_t targetStatePoolId,
DataSet *dataSet, Parameters parameters, GlobDataSet *dataSet, Parameters parameters,
RedundantHeater::Parameters heaterParameters) : RedundantHeater::Parameters heaterParameters) :
oldStrategy(ACTIVE_SINGLE), survivalTargetTemp(0), targetTemp(0), heating( oldStrategy(ACTIVE_SINGLE), survivalTargetTemp(0), targetTemp(0), heating(
false), parameters(parameters), moduleTemperature( false), parameters(parameters), moduleTemperature(
@ -16,7 +16,7 @@ ThermalModule::ThermalModule(uint32_t moduleTemperaturePoolId,
heater = new RedundantHeater(heaterParameters); heater = new RedundantHeater(heaterParameters);
} }
ThermalModule::ThermalModule(uint32_t moduleTemperaturePoolId, DataSet* dataSet) : ThermalModule::ThermalModule(uint32_t moduleTemperaturePoolId, GlobDataSet* dataSet) :
oldStrategy(ACTIVE_SINGLE), survivalTargetTemp(0), targetTemp(0), heating( oldStrategy(ACTIVE_SINGLE), survivalTargetTemp(0), targetTemp(0), heating(
false), parameters( { 0, 0 }), moduleTemperature( false), parameters( { 0, 0 }), moduleTemperature(
moduleTemperaturePoolId, dataSet, PoolVariableIF::VAR_WRITE), heater( moduleTemperaturePoolId, dataSet, PoolVariableIF::VAR_WRITE), heater(
@ -250,8 +250,8 @@ bool ThermalModule::calculateModuleHeaterRequestAndSetModuleStatus(
} }
void ThermalModule::setHeating(bool on) { void ThermalModule::setHeating(bool on) {
DataSet mySet; GlobDataSet mySet;
PoolVariable<int8_t> writableTargetState(targetState.getDataPoolId(), gp_int8_t writableTargetState(targetState.getDataPoolId(),
&mySet, PoolVariableIF::VAR_WRITE); &mySet, PoolVariableIF::VAR_WRITE);
if (on) { if (on) {
writableTargetState = STATE_REQUEST_HEATING; writableTargetState = STATE_REQUEST_HEATING;

View File

@ -70,12 +70,12 @@ protected:
Parameters parameters; Parameters parameters;
db_float_t moduleTemperature; gp_float_t moduleTemperature;
RedundantHeater *heater; RedundantHeater *heater;
db_int8_t currentState; gp_int8_t currentState;
db_int8_t targetState; gp_int8_t targetState;
std::list<AbstractTemperatureSensor *> sensors; std::list<AbstractTemperatureSensor *> sensors;
std::list<ComponentData> components; std::list<ComponentData> components;