Commit e9f50eaf authored by Carla Guillen Carias's avatar Carla Guillen Carias
Browse files

Merge branch 'development' of https://gitlab.lrz.de/dcdb/dcdb into development

parents 014b619f 91359c50
......@@ -35,6 +35,7 @@
#include "sensornavigator.h"
#include "UnitTemplate.h"
#include "mqttchecker.h"
#include "logging.h"
using namespace std;
......@@ -215,12 +216,15 @@ public:
try {
unitObjects->push_back(_generateUnit(u, inputs, outputs, inputMode, mqttPrefix, relaxed));
} catch( const exception& e) {
delete units;
delete unitObjects;
throw;
//delete units;
//delete unitObjects;
//throw;
LOG(error) << e.what();
LOG(error) << "UnitGenerator: cannot build unit " << u << "!";
continue;
}
}
if(ondemand) {
shared_ptr<UnitTemplate<SBase>> unPtr = make_shared<UnitTemplate<SBase>>(SensorNavigator::templateKey, inputs, outputs);
unPtr->setInputMode(inputMode);
......@@ -228,6 +232,11 @@ public:
}
delete units;
if(unitObjects->empty()) {
delete unitObjects;
throw invalid_argument("UnitGenerator: No units were created!");
}
return unitObjects;
}
......@@ -442,6 +451,9 @@ protected:
return unPtr;
}
// Logger object
boost::log::sources::severity_logger<boost::log::trivial::severity_level> lg;
//Internal SensorNavigator object
shared_ptr<SensorNavigator> _navi;
......
......@@ -43,7 +43,7 @@ private:
void sensorBase(AggregatorSensorBase& s, CFG_VAL config) override;
void operatorAttributes(PerSystSqlOperator& op, CFG_VAL config) override;
bool unit(UnitTemplate<AggregatorSensorBase>& u) override;
bool readUnits(PerSystSqlOperator& op, std::vector<shared_ptr<AggregatorSensorBase>>& protoInputs, std::vector<shared_ptr<AggregatorSensorBase>>& protoOutputs, inputMode_t inputMode);
bool readUnits(PerSystSqlOperator& op, std::vector<shared_ptr<AggregatorSensorBase>>& protoInputs, std::vector<shared_ptr<AggregatorSensorBase>>& protoOutputs, inputMode_t inputMode) override;
};
extern "C" OperatorConfiguratorInterface* create() {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment