Fawkes API  Fawkes Development Version
action_executor.h
1 /***************************************************************************
2  * action_executor.h - An abstract action executor for Golog++
3  *
4  * Created: Thu 03 Oct 2019 08:41:55 CEST 08:41
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 #ifndef FAWKES_GOLOGPP_ACTION_EXECUTOR_H
22 #define FAWKES_GOLOGPP_ACTION_EXECUTOR_H
23 
24 #include <golog++/model/gologpp.h>
25 
26 #include <string>
27 
28 namespace fawkes {
29 class Logger;
30 }
31 
32 namespace fawkes {
33 namespace gpp {
35 {
36 public:
37  ActionExecutor(Logger *logger);
38  virtual void start(std::shared_ptr<gologpp::Activity> activity) = 0;
39  virtual void stop(std::shared_ptr<gologpp::Grounding<gologpp::Action>> activity) = 0;
40  virtual bool can_execute_activity(std::shared_ptr<gologpp::Activity> activity) const = 0;
41 
42 protected:
43  std::shared_ptr<gologpp::Activity> running_activity_;
45 };
46 
47 } // namespace gpp
48 } // namespace fawkes
49 
50 #endif /* !FAWKES_GOLOGPP_ACTION_EXECUTOR_H */
Interface for logging.
Definition: logger.h:42
Abstract class to execute a Golog++ activity.
virtual void start(std::shared_ptr< gologpp::Activity > activity)=0
Start the given activity.
std::shared_ptr< gologpp::Activity > running_activity_
A pointer to the currently running activity.
virtual void stop(std::shared_ptr< gologpp::Grounding< gologpp::Action >> activity)=0
Stop the given activity.
virtual bool can_execute_activity(std::shared_ptr< gologpp::Activity > activity) const =0
Determine if this executor can execute the given activity.
ActionExecutor(Logger *logger)
Constructor of an abstract executor.
Logger * logger_
The logger to use for logging messages.
Fawkes library namespace.