Fawkes API
Fawkes Development Version
webview_plugin.cpp
1
2
/***************************************************************************
3
* webview_plugin.h - Fawkes Webview Plugin
4
*
5
* Created: Mon Oct 13 17:46:57 2008 (I5 Developer's Day)
6
* Copyright 2006-2018 Tim Niemueller [www.niemueller.de]
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 "webview_thread.h"
23
24
#include <core/exception.h>
25
#include <plugins/webview/webview_plugin.h>
26
27
#ifdef HAVE_REST_APIS
28
# include "backendinfo-rest-api/backendinfo-rest-api.h"
29
# include "blackboard-rest-api/blackboard-rest-api.h"
30
# include "config-rest-api/config-rest-api.h"
31
# include "plugin-rest-api/plugin-rest-api.h"
32
# ifdef HAVE_JPEG
33
# include "image-rest-api/image-rest-api.h"
34
# endif
35
# ifdef HAVE_TF
36
# include "tf-rest-api/tf-rest-api.h"
37
# endif
38
#endif
39
40
using namespace
fawkes
;
41
42
/** @class WebviewPlugin <plugins/webview/webview_plugin.h>
43
* Webview plugin for Fawkes.
44
* This provides an extensible web interface for Fawkes.
45
* @author Tim Niemueller
46
*/
47
48
/** Constructor.
49
* @param config Fawkes configuration
50
*/
51
WebviewPlugin::WebviewPlugin
(
Configuration
*config) :
Plugin
(config)
52
{
53
bool
enable_thread_pool =
config
->
get_bool
(
"/webview/thread-pool/enable"
);
54
55
thread_list
.
push_back
(
new
WebviewThread
(enable_thread_pool));
56
#ifdef HAVE_REST_APIS
57
thread_list
.
push_back
(
new
BlackboardRestApi
());
58
thread_list
.
push_back
(
new
BackendInfoRestApi
());
59
thread_list
.
push_back
(
new
PluginRestApi
());
60
thread_list
.
push_back
(
new
ConfigurationRestApi
());
61
# ifdef HAVE_JPEG
62
thread_list
.
push_back
(
new
ImageRestApi
());
63
# endif
64
# ifdef HAVE_TF
65
thread_list
.
push_back
(
new
TransformsRestApi
());
66
# endif
67
#endif
68
}
69
70
PLUGIN_DESCRIPTION(
"Web interface for Fawkes"
)
71
EXPORT_PLUGIN(
WebviewPlugin
)
fawkes::Plugin::config
Configuration * config
Fawkes configuration.
Definition:
plugin.h:62
fawkes::Plugin::thread_list
ThreadList thread_list
Thread list member.
Definition:
plugin.h:57
PluginRestApi
Definition:
plugin-rest-api.h:37
WebviewPlugin::WebviewPlugin
WebviewPlugin(fawkes::Configuration *config)
Constructor.
Definition:
webview_plugin.cpp:51
fawkes::ThreadList::push_back
void push_back(Thread *thread)
Add thread to the end.
Definition:
thread_list.cpp:777
fawkes::Configuration::get_bool
virtual bool get_bool(const char *path)=0
TransformsRestApi
Definition:
tf-rest-api.h:33
BlackboardRestApi
Definition:
blackboard-rest-api.h:41
ConfigurationRestApi
Definition:
config-rest-api.h:35
fawkes::Configuration
Definition:
config.h:68
fawkes
WebviewPlugin
Definition:
webview_plugin.h:27
BackendInfoRestApi
Definition:
backendinfo-rest-api.h:32
WebviewThread
Definition:
webview_thread.h:43
ImageRestApi
Definition:
image-rest-api.h:43
fawkes::Plugin
Definition:
plugin.h:37
src
plugins
webview
webview_plugin.cpp
Generated by
1.8.16