21#include "execution_time_estimator.h"
23#include <core/exception.h>
24#include <core/exceptions/software.h>
41std::shared_ptr<ExecutionTimeEstimator>
44 for (
const auto &pair : execution_time_estimators_) {
45 const auto &provider = pair.second;
46 if (provider->can_execute(skill_string)) {
61 execution_time_estimators_.insert(std::make_pair(priority, provider));
71 std::erase_if(execution_time_estimators_, [&](
auto &pair) {
return provider == pair.second; });
73 for (
auto it = execution_time_estimators_.begin(); it != execution_time_estimators_.end();) {
74 if (it->second == provider) {
75 it = execution_time_estimators_.erase(it);
94: execution_time_estimator_manager_(nullptr)
96 add_aspect(
"SkillExecutionTimeEstimatorAspect");
void add_aspect(const char *name)
Add an aspect to a thread.
A manager for execution time providers.
std::shared_ptr< ExecutionTimeEstimator > get_provider(const std::string &skill_string) const
Get the execution time provider for the given skill string.
void register_provider(std::shared_ptr< ExecutionTimeEstimator > provider, int priority=0)
Add an execution time provider.
void unregister_provider(std::shared_ptr< ExecutionTimeEstimator > provider)
Remove an execution time estimate provider.
ExecutionTimeEstimatorManager * execution_time_estimator_manager_
The ExecutionTimeEstimatorManager that is used to manage the estimators.
void finalize_ExecutionTimeEstimatorsAspect()
Finalize the aspect.
ExecutionTimeEstimatorsAspect()
Constructor.
void init_ExecutionTimeEstimatorsAspect(ExecutionTimeEstimatorManager *provider_manager)
Initialize the aspect with a provider manager.
Expected parameter is missing.
Fawkes library namespace.