Fawkes API
Fawkes Development Version
clips-protobuf-thread.h
1
2
/***************************************************************************
3
* clips-protobuf-thread.h - Protobuf communication for CLIPS
4
*
5
* Created: Tue Apr 16 13:02:22 2013
6
* Copyright 2006-2013 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
#ifndef _PLUGINS_CLIPS_PROTOBUF_CLIPS_PROTOBUF_THREAD_H_
24
#define _PLUGINS_CLIPS_PROTOBUF_CLIPS_PROTOBUF_THREAD_H_
25
26
#include <aspect/configurable.h>
27
#include <aspect/logging.h>
28
#include <core/threading/thread.h>
29
#include <plugins/clips/aspect/clips_feature.h>
30
31
#include <map>
32
#include <string>
33
#include <vector>
34
35
namespace
protobuf_clips {
36
class
ClipsProtobufCommunicator;
37
}
38
39
class
ClipsProtobufThread
:
public
fawkes::Thread
,
40
public
fawkes::LoggingAspect
,
41
public
fawkes::ConfigurableAspect
,
42
public
fawkes::CLIPSFeature
,
43
public
fawkes::CLIPSFeatureAspect
44
{
45
public
:
46
ClipsProtobufThread
();
47
virtual
~ClipsProtobufThread
();
48
49
virtual
void
init
();
50
virtual
void
loop
();
51
virtual
void
finalize
();
52
53
// for CLIPSFeature
54
virtual
void
clips_context_init
(
const
std::string & env_name,
55
fawkes::LockPtr<CLIPS::Environment>
&clips);
56
virtual
void
clips_context_destroyed
(
const
std::string &env_name);
57
58
/** Stub to see name in backtrace for easier debugging. @see Thread::run() */
59
protected
:
60
virtual
void
61
run
()
62
{
63
Thread::run();
64
}
65
66
private
:
67
std::map<std::string, protobuf_clips::ClipsProtobufCommunicator *> pb_comms_;
68
std::vector<std::string> cfg_proto_dirs_;
69
};
70
71
#endif
ClipsProtobufThread
Definition:
clips-protobuf-thread.h:38
fawkes::LockPtr< CLIPS::Environment >
ClipsProtobufThread::run
virtual void run()
Stub to see name in backtrace for easier debugging.
Definition:
clips-protobuf-thread.h:60
ClipsProtobufThread::finalize
virtual void finalize()
Finalize the thread.
Definition:
clips-protobuf-thread.cpp:78
ClipsProtobufThread::ClipsProtobufThread
ClipsProtobufThread()
Constructor.
Definition:
clips-protobuf-thread.cpp:34
fawkes::LoggingAspect
Definition:
logging.h:36
ClipsProtobufThread::clips_context_init
virtual void clips_context_init(const std::string &env_name, fawkes::LockPtr< CLIPS::Environment > &clips)
Definition:
clips-protobuf-thread.cpp:87
ClipsProtobufThread::~ClipsProtobufThread
virtual ~ClipsProtobufThread()
Destructor.
Definition:
clips-protobuf-thread.cpp:42
fawkes::CLIPSFeature
Definition:
clips_feature.h:40
ClipsProtobufThread::loop
virtual void loop()
Code to execute in the thread.
Definition:
clips-protobuf-thread.cpp:107
fawkes::Thread
Definition:
thread.h:44
fawkes::ConfigurableAspect
Definition:
configurable.h:36
ClipsProtobufThread::init
virtual void init()
Initialize the thread.
Definition:
clips-protobuf-thread.cpp:47
fawkes::CLIPSFeatureAspect
Definition:
clips_feature.h:56
ClipsProtobufThread::clips_context_destroyed
virtual void clips_context_destroyed(const std::string &env_name)
Definition:
clips-protobuf-thread.cpp:97
src
plugins
clips-protobuf
clips-protobuf-thread.h
Generated by
1.8.16