Fawkes API  Fawkes Development Version
clips_feature.h
1 
2 /***************************************************************************
3  * clips_feature.h - CLIPS feature aspect for Fawkes
4  *
5  * Created: Thu Jul 25 17:37:58 2013
6  * Copyright 2006-2013 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. A runtime exception applies to
14  * this software (see LICENSE.GPL_WRE file mentioned below for details).
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU Library General Public License for more details.
20  *
21  * Read the full text in the LICENSE.GPL_WRE file in the doc directory.
22  */
23 
24 #ifndef _PLUGINS_CLIPS_ASPECT_CLIPS_FEATURE_H_
25 #define _PLUGINS_CLIPS_ASPECT_CLIPS_FEATURE_H_
26 
27 #include <aspect/aspect.h>
28 #include <core/utils/lockptr.h>
29 
30 #include <string>
31 
32 namespace CLIPS {
33 class Environment;
34 }
35 
36 namespace fawkes {
37 
38 class CLIPSEnvManager;
39 class CLIPSFeatureAspectIniFin;
40 
42 {
43  friend CLIPSEnvManager;
44 
45 public:
46  CLIPSFeature(const char *feature_name);
47  virtual ~CLIPSFeature();
48 
49  virtual void clips_context_init(const std::string & env_name,
51  virtual void clips_context_destroyed(const std::string &env_name) = 0;
52 
53 protected:
54  const std::string clips_feature_name; ///< CLIPS feature name
55 };
56 
57 class CLIPSFeatureAspect : public virtual Aspect
58 {
60 
61 public:
63  CLIPSFeatureAspect(const std::list<CLIPSFeature *> features);
64  virtual ~CLIPSFeatureAspect();
65 
66 private:
67  std::list<CLIPSFeature *> clips_features_;
68 };
69 
70 } // end namespace fawkes
71 
72 #endif
Environment representation for JSON transfer.
Definition: Environment.h:28
Fawkes aspect base class.
Definition: aspect.h:32
CLIPS environment manager.
CLIPSFeatureAspect initializer/finalizer.
Thread aspect to provide a feature to CLIPS environments.
Definition: clips_feature.h:58
CLIPSFeatureAspect(CLIPSFeature *feature)
Constructor.
virtual ~CLIPSFeatureAspect()
Virtual empty destructor.
CLIPS feature maintainer.
Definition: clips_feature.h:42
CLIPSFeature(const char *feature_name)
Constructor.
virtual void clips_context_destroyed(const std::string &env_name)=0
Notification that a CLIPS environment has been destroyed.
const std::string clips_feature_name
CLIPS feature name.
Definition: clips_feature.h:54
virtual ~CLIPSFeature()
Virtual empty constructor.
virtual void clips_context_init(const std::string &env_name, fawkes::LockPtr< CLIPS::Environment > &clips)=0
Initialize a CLIPS context to use the provided feature.
Fawkes library namespace.