Fawkes API  Fawkes Development Version
clips_thread.h
1 
2 /***************************************************************************
3  * clips_thread.h - CLIPS aspect provider thread
4  *
5  * Created: Sat Jun 16 14:38:21 2012 (Mexico City)
6  * Copyright 2006-2011 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_CLIPS_THREAD_H_
24 #define __PLUGINS_CLIPS_CLIPS_THREAD_H_
25 
26 #include <core/threading/thread.h>
27 #include <aspect/aspect_provider.h>
28 #include <aspect/logging.h>
29 #include <aspect/clock.h>
30 #include <aspect/configurable.h>
31 #include <aspect/blackboard.h>
32 #include <plugins/clips/aspect/clips_inifin.h>
33 #include <plugins/clips/aspect/clips_feature_inifin.h>
34 #include <plugins/clips/aspect/clips_manager_inifin.h>
35 
36 namespace CLIPS {
37  class Environment;
38 }
39 namespace fawkes {
40  class AspectIniFin;
41  class CLIPSFeature;
42 }
43 
45 
47 : public fawkes::Thread,
48  public fawkes::LoggingAspect,
49  public fawkes::ClockAspect,
53 {
54  public:
55  CLIPSThread();
56  virtual ~CLIPSThread();
57 
58  virtual void init();
59  virtual void loop();
60  virtual void finalize();
61 
62  /** Stub to see name in backtrace for easier debugging. @see Thread::run() */
63  protected: virtual void run() { Thread::run(); }
64 
65  private:
66  const std::list<fawkes::AspectIniFin *> inifin_list();
67 
68  private:
69  fawkes::CLIPSAspectIniFin clips_aspect_inifin_;
70  fawkes::CLIPSFeatureAspectIniFin clips_feature_aspect_inifin_;
71  fawkes::CLIPSManagerAspectIniFin clips_manager_aspect_inifin_;
73 
74  std::list<fawkes::CLIPSFeature *> features_;
75 };
76 
77 #endif
Thread aspect to access to BlackBoard.
Definition: blackboard.h:34
Thread aspect that allows to obtain the current time from the clock.
Definition: clock.h:36
CLIPSManagerAspect initializer/finalizer.
Fawkes library namespace.
virtual void run()
Stub to see name in backtrace for easier debugging.
Definition: clips_thread.h:63
Thread class encapsulation of pthreads.
Definition: thread.h:42
CLIPS environment thread.
Definition: clips_thread.h:46
CLIPS blackboard feature.
Thread aspect to log output.
Definition: logging.h:35
CLIPSFeatureAspect initializer/finalizer.
Definition: clips.h:32
Thread aspect provide a new aspect.
Thread aspect to access configuration data.
Definition: configurable.h:35
CLIPSAspect initializer/finalizer.
Definition: clips_inifin.h:41