Skip to content
Snippets Groups Projects
Commit 4d94ced6 authored by Jeremie Deray's avatar Jeremie Deray
Browse files

assert sensor ptr !nullptr when installing processor

parent d1a28acf
No related branches found
No related tags found
1 merge request!116assert sensor ptr !nullptr when installing processor
...@@ -91,6 +91,13 @@ ProcessorBasePtr Problem::installProcessor(const std::string& _prc_type, // ...@@ -91,6 +91,13 @@ ProcessorBasePtr Problem::installProcessor(const std::string& _prc_type, //
SensorBasePtr _corresponding_sensor_ptr, // SensorBasePtr _corresponding_sensor_ptr, //
ProcessorParamsBasePtr _prc_params) ProcessorParamsBasePtr _prc_params)
{ {
if (_corresponding_sensor_ptr == nullptr)
{
WOLF_ERROR("Cannot install processor '", _unique_processor_name,
"' since the associated sensor does not exist !");
return ProcessorBasePtr();
}
ProcessorBasePtr prc_ptr = ProcessorFactory::get().create(uppercase(_prc_type), _unique_processor_name, _prc_params, _corresponding_sensor_ptr); ProcessorBasePtr prc_ptr = ProcessorFactory::get().create(uppercase(_prc_type), _unique_processor_name, _prc_params, _corresponding_sensor_ptr);
_corresponding_sensor_ptr->addProcessor(prc_ptr); _corresponding_sensor_ptr->addProcessor(prc_ptr);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment