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;
ReturnValue_t read() {
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);
if (read_out != NULL) {
valid = read_out->valid;

View File

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

View File

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

View File

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

View File

@ -111,11 +111,11 @@ ReturnValue_t GlobDataSet::handleUnreadDatasetCommit() {
}
ReturnValue_t GlobDataSet::unlockDataPool() {
return ::dataPool.freeDataPoolLock();
return glob::dataPool.freeDataPoolLock();
}
ReturnValue_t GlobDataSet::lockDataPool() {
return ::dataPool.lockDataPool();
return glob::dataPool.lockDataPool();
}
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>
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) {
valid = read_out->valid;
value = *(read_out->address);
@ -29,7 +29,7 @@ inline ReturnValue_t GlobPoolVar<T>::read() {
template <class T>
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)) {
write_back->valid = valid;
*(write_back->address) = value;

View File

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

View File

@ -1141,7 +1141,7 @@ void DeviceHandlerBase::handleDeviceTM(SerializeIF* data,
}
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();
if (result != HasReturnvaluesIF::RETURN_OK) {
return result;

View File

@ -482,7 +482,8 @@ public:
virtual void setParentQueue(MessageQueueId_t parentQueueId);
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;
Submode_t getTransitionSourceSubMode() const;
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)/datalinklayer/*.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)/events/*.cpp)
CXXSRC += $(wildcard $(FRAMEWORK_PATH)/events/eventmatching/*.cpp)

View File

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

View File

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

View File

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

View File

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

View File

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