Fawkes API  Fawkes Development Version
clips_pddl_parser_thread.cpp
1 /***************************************************************************
2  * clips_pddl_parser_thread.cpp - CLIPS feature for parsing PDDL domains
3  *
4  * Created: Fri 16 Feb 2018 17:59:31 CET 17:59
5  * Copyright 2018 Till Hofmann <hofmann@kbsg.rwth-aachen.de>
6  ****************************************************************************/
7 
8 /* This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU Library General Public License for more details.
17  *
18  * Read the full text in the LICENSE.GPL file in the doc directory.
19  */
20 
21 #include "clips_pddl_parser_thread.h"
22 
23 #include "clips_pddl_parser_feature.h"
24 
25 /** @class ClipsPddlParserThread "clips_pddl_parser_thread.h"
26  * Plugin thread that provides the pddl-parser CLIPS features.
27  * @author Till Hofmann
28  */
29 
30 ClipsPddlParserThread::ClipsPddlParserThread()
31 : Thread("ClipsPddlParserThread", Thread::OPMODE_WAITFORWAKEUP),
32  CLIPSFeatureAspect(new PDDLCLIPSFeature())
33 {
34 }
35 
36 void
38 {
39  for (auto &feature : clips_features_) {
40  auto pddl_feature = dynamic_cast<PDDLCLIPSFeature *>(feature);
41  if (pddl_feature) {
42  pddl_feature->init_logger(logger);
43  }
44  }
45 }
void init()
Initialize the thread.
Provide a PDDL parser to a CLIPS environment.
void init_logger(fawkes::Logger *logger)
Initialize the looger to use.
std::list< CLIPSFeature * > clips_features_
List of all clips features.
Definition: clips_feature.h:68
Logger * logger
This is the Logger member used to access the logger.
Definition: logging.h:41