Fawkes API  Fawkes Development Version
clips_rm_trigger.h
1 /***************************************************************************
2  * clips_rm_trigger.h - Class holding information and callback for trigger in CLIPS
3  *
4  *
5  * Created: 11:57:31 AM 2016
6  * Copyright 2016 Frederik Zwilling
7  ****************************************************************************/
8 
9 /* This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU Library General Public License for more details.
18  *
19  * Read the full text in the LICENSE.GPL file in the doc directory.
20  */
21 
22 #ifndef FAWKES_SRC_PLUGINS_CLIPS_ROBOT_MEMORY_CLIPS_RM_TRIGGER_H_
23 #define FAWKES_SRC_PLUGINS_CLIPS_ROBOT_MEMORY_CLIPS_RM_TRIGGER_H_
24 
25 #include <core/utils/lockptr.h>
26 #include <logging/logger.h>
27 #include <plugins/robot-memory/robot_memory.h>
28 
29 #include <bsoncxx/document/view.hpp>
30 #include <clipsmm.h>
31 #include <string>
32 
33 /** @class ClipsRmTrigger clips_rm_trigger.h
34  *
35  * @author Frederik Zwilling
36  */
37 class ClipsRmTrigger
38 {
39 public:
40  ClipsRmTrigger(std::string assert_name,
41  RobotMemory * robot_memory,
43  fawkes::Logger * logger);
44  virtual ~ClipsRmTrigger();
45 
46  void callback(const bsoncxx::document::view &update);
47  void set_trigger(EventTrigger *trigger);
48 
49 private:
50  std::string assert_name;
51  EventTrigger * trigger;
52  RobotMemory * robot_memory;
54  fawkes::Logger * logger;
55 };
56 
57 #endif /* FAWKES_SRC_PLUGINS_CLIPS_ROBOT_MEMORY_CLIPS_RM_TRIGGER_H_ */
ClipsRmTrigger::callback
void callback(const bsoncxx::document::view &update)
Callback function for the trigger.
Definition: clips_rm_trigger.cpp:73
fawkes::LockPtr< CLIPS::Environment >
RobotMemory
Definition: robot_memory.h:45
EventTrigger
Definition: event_trigger.h:30
ClipsRmTrigger::set_trigger
void set_trigger(EventTrigger *trigger)
Set the trigger object given by the robot memory.
Definition: clips_rm_trigger.cpp:62
ClipsRmTrigger::ClipsRmTrigger
ClipsRmTrigger(std::string assert_name, RobotMemory *robot_memory, fawkes::LockPtr< CLIPS::Environment > &clips, fawkes::Logger *logger)
Constructor with references to objects of the plugin.
Definition: clips_rm_trigger.cpp:39
fawkes::Logger
Definition: logger.h:40
ClipsRmTrigger
Definition: clips_rm_trigger.h:36