Fawkes API  Fawkes Development Version
execution_time_estimator.h
1 /***************************************************************************
2  * execution_time_estimator_aspect.h - Aspect for a running time provider
3  *
4  * Created: Thu 12 Dec 2019 14:52:41 CET 14:52
5  * Copyright 2019 Till Hofmann <hofmann@kbsg.rwth-aachen.de>
6  ****************************************************************************/
7 
8 /* This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU Library General Public License for more details.
17  *
18  * Read the full text in the LICENSE.GPL file in the doc directory.
19  */
20 
21 #pragma once
22 
23 #include <aspect/aspect.h>
24 #include <execution_time_estimator/execution_time_estimator.h>
25 
26 #include <map>
27 #include <memory>
28 
29 namespace fawkes {
30 
32 {
33 public:
34  std::shared_ptr<ExecutionTimeEstimator> get_provider(const std::string &skill_string) const;
35  void register_provider(std::shared_ptr<ExecutionTimeEstimator> provider, int priority = 0);
36  void unregister_provider(std::shared_ptr<ExecutionTimeEstimator> provider);
37 
38 private:
39  std::multimap<int, std::shared_ptr<ExecutionTimeEstimator>, std::greater<int>>
40  execution_time_estimators_;
41 };
42 
43 class ExecutionTimeEstimatorsAspect : public virtual Aspect
44 {
45 public:
49 
50 protected:
52 };
53 
54 } // namespace fawkes
Fawkes aspect base class.
Definition: aspect.h:32
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.
An aspect to give access to the execution time estimator manager.
ExecutionTimeEstimatorManager * execution_time_estimator_manager_
The ExecutionTimeEstimatorManager that is used to manage the estimators.
void finalize_ExecutionTimeEstimatorsAspect()
Finalize the aspect.
void init_ExecutionTimeEstimatorsAspect(ExecutionTimeEstimatorManager *provider_manager)
Initialize the aspect with a provider manager.
Fawkes library namespace.