Fawkes API
Fawkes Development Version
eclipse_thread.h
1
2
/***************************************************************************
3
* eclipse_thread.h - Fawkes ECLiPSe Thread
4
*
5
* Created: Wed Jul 16 10:20:51 2009
6
* Copyright 2009 Daniel Beck
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
#ifndef _PLUGINS_ECLIPSE_CLP_ECLIPSE_THREAD_H_
24
#define _PLUGINS_ECLIPSE_CLP_ECLIPSE_THREAD_H_
25
26
#include <aspect/blackboard.h>
27
#include <aspect/configurable.h>
28
#include <aspect/logging.h>
29
#include <core/threading/mutex.h>
30
#include <core/threading/thread.h>
31
32
#include <eclipseclass.h>
33
#include <string>
34
#include <vector>
35
36
namespace
fawkes
{
37
class
Interface;
38
class
Mutex;
39
}
// namespace fawkes
40
41
class
EclipseAgentThread
:
public
fawkes::Thread
,
42
public
fawkes::BlackBoardAspect
,
43
public
fawkes::ConfigurableAspect
,
44
public
fawkes::LoggingAspect
45
{
46
public
:
47
EclipseAgentThread
();
48
virtual
~EclipseAgentThread
();
49
50
virtual
void
init
();
51
virtual
void
finalize
();
52
virtual
void
once
();
53
virtual
void
loop
();
54
55
void
post_event
(
const
char
*);
56
fawkes::Logger
*
get_logger
();
57
58
static
EclipseAgentThread
*
instance
();
59
60
private
:
/* methods */
61
bool
load_file(
const
char
*filename);
62
63
private
:
/* members */
64
static
EclipseAgentThread
*m_instance;
65
66
bool
m_initialized;
67
std::string agent;
68
std::string graph_path;
69
int
ec_result;
70
EC_ref ec_yield_reason;
71
fawkes::Mutex
*mutex;
72
};
73
74
#endif
/* PLUGINS_ECLIPSE_CLP_ECLIPSE_THREAD_H__ */
EclipseAgentThread::instance
static EclipseAgentThread * instance()
Get the EclipseAgentThread instance.
Definition:
eclipse_thread.cpp:255
EclipseAgentThread::get_logger
fawkes::Logger * get_logger()
Get the logger.
Definition:
eclipse_thread.cpp:246
EclipseAgentThread::~EclipseAgentThread
virtual ~EclipseAgentThread()
Destructor.
Definition:
eclipse_thread.cpp:68
fawkes::Mutex
Definition:
mutex.h:38
EclipseAgentThread::init
virtual void init()
Initialize the thread.
Definition:
eclipse_thread.cpp:78
EclipseAgentThread::EclipseAgentThread
EclipseAgentThread()
Constructor.
Definition:
eclipse_thread.cpp:59
EclipseAgentThread
Definition:
eclipse_thread.h:41
EclipseAgentThread::loop
virtual void loop()
Code to execute in the thread.
Definition:
eclipse_thread.cpp:182
fawkes::Logger
Definition:
logger.h:41
fawkes::BlackBoardAspect
Definition:
blackboard.h:38
fawkes
fawkes::LoggingAspect
Definition:
logging.h:38
EclipseAgentThread::post_event
void post_event(const char *)
Post an event to the ECLiPSe context.
Definition:
eclipse_thread.cpp:208
fawkes::Thread
Definition:
thread.h:45
fawkes::ConfigurableAspect
Definition:
configurable.h:38
EclipseAgentThread::once
virtual void once()
Execute an action exactly once.
Definition:
eclipse_thread.cpp:175
EclipseAgentThread::finalize
virtual void finalize()
Finalize the thread.
Definition:
eclipse_thread.cpp:167
src
plugins
eclipse-clp
eclipse_thread.h
Generated by
1.8.17