Fawkes API Fawkes Development Version
asp_thread.h
1
2/***************************************************************************
3 * asp_thread.h - ASP aspect provider thread
4 *
5 * Created: Thu Oct 20 15:49:31 2016
6 * Copyright 2016 Björn Schäpers
7 * 2018 Tim Niemueller [www.niemueller.org]
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#ifndef _PLUGINS_ASP_ASP_THREAD_H_
24#define _PLUGINS_ASP_ASP_THREAD_H_
25
26#include <aspect/aspect_provider.h>
27#include <aspect/logging.h>
28#include <core/threading/thread.h>
29#include <plugins/asp/aspect/asp_inifin.h>
30#include <plugins/asp/aspect/clingo_control_manager.h>
31#include <plugins/asp/aspect/clingo_manager_inifin.h>
32
33namespace fawkes {
34class AspectIniFin;
35}
36
40{
41public:
42 ASPThread();
43
44 void init() override;
45 void loop() override;
46 void finalize() override;
47
48protected:
49 /** Stub to see name in backtrace for easier debugging. @see Thread::run() */
50 void
51 run() override
52 {
53 Thread::run();
54 }
55
56private:
57 fawkes::ASPAspectIniFin asp_inifin_;
58 fawkes::ClingoManagerAspectIniFin clingo_mgr_inifin_;
60};
61
62#endif
ASP environment thread.
Definition: asp_thread.h:40
void loop() override
Code to execute in the thread.
Definition: asp_thread.cpp:65
ASPThread()
Constructor.
Definition: asp_thread.cpp:44
void run() override
Stub to see name in backtrace for easier debugging.
Definition: asp_thread.h:51
void init() override
Initialize the thread.
Definition: asp_thread.cpp:52
void finalize() override
Finalize the thread.
Definition: asp_thread.cpp:60
ASPAspect initializer/finalizer.
Definition: asp_inifin.h:37
Thread aspect provide a new aspect.
ClingoManagerAspect initializer/finalizer.
Thread aspect to log output.
Definition: logging.h:33
Thread class encapsulation of pthreads.
Definition: thread.h:46
Fawkes library namespace.