Fawkes API  Fawkes Development Version
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
clips_thread.cpp
1 
2 /***************************************************************************
3  * clips_thread.cpp - CLIPS environment providing Thread
4  *
5  * Created: Sat Jun 16 14:40:56 2012
6  * Copyright 2006-2012 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 #include "clips_thread.h"
24 
25 #include <clipsmm.h>
26 
27 using namespace fawkes;
28 
29 /** @class CLIPSThread "clips_thread.h"
30  * CLIPS environment thread.
31  *
32  * @author Tim Niemueller
33  */
34 
35 /** Constructor. */
37  : Thread("CLIPSThread", Thread::OPMODE_WAITFORWAKEUP),
38  AspectProviderAspect("CLIPSAspect", &__clips_aspect_inifin)
39 {
40 }
41 
42 
43 /** Destructor. */
45 {
46 }
47 
48 
49 void
51 {
52  CLIPS::init();
53  __clips_aspect_inifin.set_logger(logger);
54  logger->log_info(name(), "CLIPS initialized");
55 }
56 
57 
58 void
60 {
61 }
62 
63 
64 void
66 {
67 }
virtual void log_info(const char *component, const char *format,...)=0
Log informational message.
Thread class encapsulation of pthreads.
Definition: thread.h:42
virtual void init()
Initialize the thread.
virtual ~CLIPSThread()
Destructor.
Logger * logger
This is the Logger member used to access the logger.
Definition: logging.h:44
CLIPSThread()
Constructor.
const char * name() const
Get name of thread.
Definition: thread.h:95
Thread aspect provide a new aspect.
virtual void finalize()
Finalize the thread.
virtual void loop()
Code to execute in the thread.
void set_logger(Logger *logger)
Set the logger to use for logging (print to "l" output).