Fawkes API
Fawkes Development Version
skiller-rest-api.h
1
2
/***************************************************************************
3
* skiller-rest-api.h - Behavior Engine REST API
4
*
5
* Created: Mon Mar 26 22:00:43 2018 +0200
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
#pragma once
23
24
#include "model/Skill.h"
25
#include "model/SkillCall.h"
26
#include "model/SkillInfo.h"
27
28
#include <aspect/blackboard.h>
29
#include <aspect/clock.h>
30
#include <aspect/logging.h>
31
#include <aspect/webview.h>
32
#include <core/threading/thread.h>
33
#include <webview/rest_api.h>
34
#include <webview/rest_array.h>
35
36
namespace
fawkes
{
37
class
SkillerDebugInterface;
38
class
SkillerInterface;
39
}
// namespace fawkes
40
41
class
SkillerRestApi
:
public
fawkes::Thread
,
42
public
fawkes::ClockAspect
,
43
public
fawkes::LoggingAspect
,
44
public
fawkes::BlackBoardAspect
,
45
public
fawkes::WebviewAspect
46
{
47
public
:
48
SkillerRestApi
();
49
~SkillerRestApi
();
50
51
virtual
void
init
();
52
virtual
void
loop
();
53
virtual
void
finalize
();
54
55
private
:
56
WebviewRestArray<SkillInfo>
cb_list_skills();
57
58
Skill
cb_get_skill(
fawkes::WebviewRestParams
¶ms);
59
60
Skill
cb_exec_skill(
const
SkillCall
&call);
61
62
std::unique_ptr<fawkes::WebviewRestReply> cb_stop_skill(
fawkes::WebviewRestParams
¶ms);
63
64
void
set_and_wait_graph(
const
char
*graph);
65
66
private
:
67
fawkes::WebviewRestApi
* rest_api_;
68
fawkes::SkillerDebugInterface
*skdb_if_;
69
fawkes::SkillerInterface
* skiller_if_;
70
};
SkillerRestApi::finalize
virtual void finalize()
Finalize the thread.
Definition:
skiller-rest-api.cpp:73
SkillerRestApi::init
virtual void init()
Initialize the thread.
Definition:
skiller-rest-api.cpp:48
SkillCall
SkillCall representation for JSON transfer.
Definition:
SkillCall.h:27
SkillerRestApi::~SkillerRestApi
~SkillerRestApi()
Destructor.
Definition:
skiller-rest-api.cpp:43
SkillerRestApi
Definition:
skiller-rest-api.h:41
fawkes::BlackBoardAspect
Definition:
blackboard.h:38
fawkes
fawkes::LoggingAspect
Definition:
logging.h:38
Skill
Skill representation for JSON transfer.
Definition:
Skill.h:27
fawkes::SkillerDebugInterface
Definition:
SkillerDebugInterface.h:39
WebviewRestArray
Container to return array via REST.
Definition:
rest_array.h:35
SkillerRestApi::SkillerRestApi
SkillerRestApi()
Constructor.
Definition:
skiller-rest-api.cpp:38
fawkes::SkillerInterface
Definition:
SkillerInterface.h:39
fawkes::WebviewRestParams
REST parameters to pass to handlers.
Definition:
rest_api.h:129
fawkes::WebviewAspect
Definition:
webview.h:42
fawkes::WebviewRestApi
Definition:
rest_api.h:225
fawkes::Thread
Definition:
thread.h:45
fawkes::ClockAspect
Definition:
clock.h:40
SkillerRestApi::loop
virtual void loop()
Code to execute in the thread.
Definition:
skiller-rest-api.cpp:80
src
plugins
skiller
rest-api
skiller-rest-api.h
Generated by
1.8.17