diff --git a/include/core/problem/problem.h b/include/core/problem/problem.h index d85a6503b1a0e544c26d358d5444036b7980b612..08a7ab52fd0598315adf2b9150ad80efd77043d0 100644 --- a/include/core/problem/problem.h +++ b/include/core/problem/problem.h @@ -152,6 +152,10 @@ class Problem : public std::enable_shared_from_this<Problem> * \param _sensor_name The sensor name, as it was installed with installSensor() */ SensorBasePtr findSensor(const std::string& _sensor_name) const; + /** \brief get a processor pointer by its name + * \param _processor_name The processor name, as it was installed with installProcessor() + */ + ProcessorBasePtr findProcessor(const std::string& _processor_name) const; /** \brief Factory method to install (create, and add to sensor) processors only from its properties * diff --git a/src/problem/problem.cpp b/src/problem/problem.cpp index 3c731dc3ebab4c1c84ada15929a06166a77c9852..d80dafb51c2d4e2dfd772c19fa0786e4f5c173b7 100644 --- a/src/problem/problem.cpp +++ b/src/problem/problem.cpp @@ -350,6 +350,16 @@ SensorBasePtr Problem::findSensor(const std::string& _sensor_name) const return (*sen_it); } +ProcessorBasePtr Problem::findProcessor(const std::string& _processor_name) const +{ + for (const auto& sensor : getHardware()->getSensorList()) + for (const auto& processor : sensor->getProcessorList()) + if (processor->getName() == _processor_name) + return processor; + return nullptr; +} + + FrameBasePtr Problem::emplaceFrame(const TimeStamp& _time_stamp, // const StateStructure& _frame_structure, // const SizeEigen _dim, //