Fawkes API  Fawkes Development Version
message_action_executor.h
1 /***************************************************************************
2  * message_action_executor.h - Action executor for blackboard messages
3  *
4  * Created: Wed 30 Oct 2019 13:05:15 CET 13:05
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 "action_executor.h"
24 
25 #include <map>
26 #include <string>
27 
28 namespace fawkes {
29 
30 class BlackBoard;
31 class Configuration;
32 class Interface;
33 class Logger;
34 
35 namespace gpp {
37 {
38 public:
40  BlackBoard * blackboard,
41  Configuration * config,
42  const std::string &cfg_prefix);
43  virtual ~BBMessageActionExecutor();
44  void start(std::shared_ptr<gologpp::Activity> activity) override;
45  void stop(std::shared_ptr<gologpp::Grounding<gologpp::Action>> activity) override;
46  bool can_execute_activity(std::shared_ptr<gologpp::Activity> activity) const override;
47 
48 private:
49  BlackBoard * blackboard_;
50  Configuration * config_;
51  std::string cfg_prefix_;
52  std::map<std::string, Interface *> open_interfaces_;
53 };
54 } // namespace gpp
55 } // namespace fawkes
The BlackBoard abstract class.
Definition: blackboard.h:46
Interface for configuration handling.
Definition: config.h:68
Interface for logging.
Definition: logger.h:42
Abstract class to execute a Golog++ activity.
A Golog++ action executor that sends a message to a blackboard interface.
bool can_execute_activity(std::shared_ptr< gologpp::Activity > activity) const override
Determine if this executor can execute the given activity.
BBMessageActionExecutor(Logger *logger, BlackBoard *blackboard, Configuration *config, const std::string &cfg_prefix)
Constructor.
void start(std::shared_ptr< gologpp::Activity > activity) override
Start the given activity.
void stop(std::shared_ptr< gologpp::Grounding< gologpp::Action >> activity) override
Stop the given activity.
Fawkes library namespace.