Fawkes API
Fawkes Development Version
asp_thread.cpp
1
/***************************************************************************
2
* asp_thread.cpp - ASP environment providing Thread
3
*
4
* Created: Thu Oct 20 15:49:31 2016
5
* Copyright 2016 Björn Schäpers
6
*
7
****************************************************************************/
8
9
/* This program is free software; you can redistribute it and/or modify
10
* it under the terms of the GNU General Public License as published by
11
* the Free Software Foundation; either version 2 of the License, or
12
* (at your option) any later version.
13
*
14
* This program is distributed in the hope that it will be useful,
15
* but WITHOUT ANY WARRANTY; without even the implied warranty of
16
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
* GNU Library General Public License for more details.
18
*
19
* Read the full text in the LICENSE.GPL file in the doc directory.
20
*/
21
22
#include "asp_thread.h"
23
24
#include <clingo.hh>
25
26
using namespace
fawkes
;
27
28
/** @class ASPThread "clips_thread.h"
29
* ASP environment thread.
30
*
31
* @author Björn Schäpers
32
*
33
* @property ASPThread::asp_inifin_
34
* @brief The initializer/finalizer for the ASPAspect.
35
*
36
* @property ASPThread::clingo_mgr_inifin_
37
* @brief The initializer/finalizer for the ClingoManagerAspect.
38
*
39
* @property ASPThread::control_mgr_
40
* @brief The clingo control manager.
41
*/
42
43
/** Constructor. */
44
ASPThread::ASPThread
()
45
:
Thread
(
"ASPThread"
,
Thread
::OPMODE_WAITFORWAKEUP),
46
AspectProviderAspect
({&asp_inifin_, &clingo_mgr_inifin_}),
47
control_mgr_(
new
ClingoControlManager
)
48
{
49
}
50
51
void
52
ASPThread::init
()
53
{
54
control_mgr_->
set_logger
(
logger
);
55
asp_inifin_.
set_control_manager
(control_mgr_);
56
clingo_mgr_inifin_.
set_control_manager
(control_mgr_);
57
}
58
59
void
60
ASPThread::finalize
()
61
{
62
}
63
64
void
65
ASPThread::loop
()
66
{
67
}
fawkes::AspectProviderAspect
Definition:
aspect_provider.h:41
fawkes::ClingoManagerAspectIniFin::set_control_manager
void set_control_manager(LockPtr< ClingoControlManager > &clingo_ctrl_mgr)
Set Clingo control manger.
Definition:
clingo_manager_inifin.cpp:83
fawkes::LoggingAspect::logger
Logger * logger
Definition:
logging.h:53
fawkes
ASPThread::finalize
void finalize() override
Finalize the thread.
Definition:
asp_thread.cpp:60
ASPThread::ASPThread
ASPThread()
Constructor.
Definition:
asp_thread.cpp:44
ASPThread::loop
void loop() override
Code to execute in the thread.
Definition:
asp_thread.cpp:65
fawkes::Thread
Definition:
thread.h:45
fawkes::ClingoControlManager::set_logger
void set_logger(Logger *logger)
Sets the logger for all Clingo Controls.
Definition:
clingo_control_manager.cpp:56
fawkes::ClingoControlManager
Definition:
clingo_control_manager.h:41
ASPThread::init
void init() override
Initialize the thread.
Definition:
asp_thread.cpp:52
fawkes::ASPAspectIniFin::set_control_manager
void set_control_manager(const LockPtr< ClingoControlManager > &ctrl_mgr)
Sets the control manager.
Definition:
asp_inifin.cpp:90
src
plugins
asp
asp_thread.cpp
Generated by
1.8.17