Fawkes API  Fawkes Development Version
clips_executive_thread.h
1 
2 /***************************************************************************
3  * clips_executive_thread.h - CLIPS-based executive plugin
4  *
5  * Created: Tue Sep 19 11:59:44 2017
6  * Copyright 2006-2017 Tim Niemueller [www.niemueller.de]
7  *
8  ****************************************************************************/
9 
10 /* This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU Library General Public License for more details.
19  *
20  * Read the full text in the LICENSE.GPL file in the doc directory.
21  */
22 
23 #ifndef _PLUGINS_CLIPS_EXECUTIVE_CLIPS_EXECUTIVE_THREAD_H_
24 #define _PLUGINS_CLIPS_EXECUTIVE_CLIPS_EXECUTIVE_THREAD_H_
25 
26 #include <aspect/blocked_timing.h>
27 #include <aspect/clock.h>
28 #include <aspect/configurable.h>
29 #include <aspect/logging.h>
30 #include <core/threading/thread.h>
31 #include <plugins/clips/aspect/clips.h>
32 #include <utils/time/time.h>
33 
34 #include <clipsmm.h>
35 #include <memory>
36 
37 namespace fawkes {
38 class ActionSkillMapping;
39 }
40 
43  public fawkes::LoggingAspect,
45  public fawkes::ClockAspect,
46  public fawkes::CLIPSAspect
47 {
48 public:
50  virtual ~ClipsExecutiveThread();
51 
52  virtual void init();
53  virtual void loop();
54  virtual void finalize();
55 
56  /** Stub to see name in backtrace for easier debugging. @see Thread::run() */
57 protected:
58  virtual void
59  run()
60  {
61  Thread::run();
62  }
63 
64 private:
65  std::string
66  clips_map_skill(std::string name, CLIPS::Values param_names, CLIPS::Values param_values);
67 
68 private:
69  bool cfg_assert_time_each_loop_;
70 
71  std::shared_ptr<fawkes::ActionSkillMapping> action_skill_mapping_;
72 };
73 
74 #endif
ClipsExecutiveThread::~ClipsExecutiveThread
virtual ~ClipsExecutiveThread()
Destructor.
Definition: clips_executive_thread.cpp:46
ClipsExecutiveThread::init
virtual void init()
Initialize the thread.
Definition: clips_executive_thread.cpp:51
fawkes::BlockedTimingAspect
Definition: blocked_timing.h:54
fawkes::Thread::name
const char * name() const
Definition: thread.h:99
ClipsExecutiveThread::ClipsExecutiveThread
ClipsExecutiveThread()
Constructor.
Definition: clips_executive_thread.cpp:38
ClipsExecutiveThread
Definition: clips_executive_thread.h:40
ClipsExecutiveThread::run
virtual void run()
Stub to see name in backtrace for easier debugging.
Definition: clips_executive_thread.h:58
ClipsExecutiveThread::loop
virtual void loop()
Code to execute in the thread.
Definition: clips_executive_thread.cpp:165
fawkes
fawkes::LoggingAspect
Definition: logging.h:36
fawkes::CLIPSAspect
Definition: clips.h:39
fawkes::Thread
Definition: thread.h:44
ClipsExecutiveThread::finalize
virtual void finalize()
Finalize the thread.
Definition: clips_executive_thread.cpp:157
fawkes::ConfigurableAspect
Definition: configurable.h:36
fawkes::ClockAspect
Definition: clock.h:38