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
32namespace CLIPS {
33class Environment;
34}
35
36namespace fawkes {
37
38class CLIPSEnvManager;
39class CLIPSFeatureAspectIniFin;
40
42{
43 friend CLIPSEnvManager;
44
45public:
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
53protected:
54 const std::string clips_feature_name; ///< CLIPS feature name
55};
56
57class CLIPSFeatureAspect : public virtual Aspect
58{
60
61public:
63 CLIPSFeatureAspect(const std::list<CLIPSFeature *> features);
64 virtual ~CLIPSFeatureAspect();
65
66protected:
67 /** List of all clips features */
68 std::list<CLIPSFeature *> clips_features_;
69};
70
71} // end namespace fawkes
72
73#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.
std::list< CLIPSFeature * > clips_features_
List of all clips features.
Definition: clips_feature.h:68
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.