Fawkes API  Fawkes Development Version
clips.cpp
00001 
00002 /***************************************************************************
00003  *  clips.cpp - CLIPS aspect for Fawkes
00004  *
00005  *  Created: Sat Jun 16 14:30:44 2012
00006  *  Copyright  2006-2012  Tim Niemueller [www.niemueller.de]
00007  *
00008  ****************************************************************************/
00009 
00010 /*  This program is free software; you can redistribute it and/or modify
00011  *  it under the terms of the GNU General Public License as published by
00012  *  the Free Software Foundation; either version 2 of the License, or
00013  *  (at your option) any later version. A runtime exception applies to
00014  *  this software (see LICENSE.GPL_WRE file mentioned below for details).
00015  *
00016  *  This program is distributed in the hope that it will be useful,
00017  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00018  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019  *  GNU Library General Public License for more details.
00020  *
00021  *  Read the full text in the LICENSE.GPL_WRE file in the doc directory.
00022  */
00023 
00024 #include <plugins/clips/aspect/clips.h>
00025 #include <clipsmm.h>
00026 
00027 namespace fawkes {
00028 #if 0 /* just to make Emacs auto-indent happy */
00029 }
00030 #endif
00031 
00032 /** @class CLIPSAspect <plugins/clips/aspect/clips.h>
00033  * Thread aspect to get access to a CLIPS environment.
00034  * Give this aspect to your thread to get a CLIPS environment for exclusive
00035  * usage.
00036  *
00037  * @ingroup Aspects
00038  * @author Tim Niemueller
00039  */
00040 
00041 /** @var fawkes:LockPtr<CLIPS::Environment> CLIPSAspect::clips
00042  * CLIPS environment for exclusive usage.
00043  */
00044 
00045 /** Constructor. */
00046 CLIPSAspect::CLIPSAspect()
00047 {
00048   add_aspect("CLIPSAspect");
00049 }
00050 
00051 
00052 /** Virtual empty destructor. */
00053 CLIPSAspect::~CLIPSAspect()
00054 {
00055 }
00056 
00057 
00058 /** Init CLIPS aspect.
00059  * This set the CLIPS environment.
00060  * It is guaranteed that this is called for a CLIPS Thread before start
00061  * is called (when running regularly inside Fawkes).
00062  * @param clips CLIPS environment
00063  */
00064 void
00065 CLIPSAspect::init_CLIPSAspect(LockPtr<CLIPS::Environment> clips)
00066 {
00067   this->clips = clips;
00068 }
00069 
00070 /** Finalize CLIPS aspect.
00071  * This clears the CLIPS environment.
00072  */
00073 void
00074 CLIPSAspect::finalize_CLIPSAspect()
00075 {
00076   clips.clear();
00077 }
00078 
00079 } // end namespace fawkes