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
36namespace fawkes {
37class SkillerDebugInterface;
38class SkillerInterface;
39} // namespace fawkes
40
46{
47public:
50
51 virtual void init();
52 virtual void loop();
53 virtual void finalize();
54
55private:
56 WebviewRestArray<SkillInfo> cb_list_skills();
57
58 Skill cb_get_skill(fawkes::WebviewRestParams &params);
59
60 Skill cb_exec_skill(const SkillCall &call);
61
62 std::unique_ptr<fawkes::WebviewRestReply> cb_stop_skill(fawkes::WebviewRestParams &params);
63
64 void set_and_wait_graph(const char *graph);
65
66private:
67 fawkes::WebviewRestApi * rest_api_;
69 fawkes::SkillerInterface * skiller_if_;
70};
SkillCall representation for JSON transfer.
Definition: SkillCall.h:29
Skill representation for JSON transfer.
Definition: Skill.h:29
REST API backend for the CLIPS executive.
virtual void init()
Initialize the thread.
virtual void finalize()
Finalize the thread.
~SkillerRestApi()
Destructor.
SkillerRestApi()
Constructor.
virtual void loop()
Code to execute in the thread.
Container to return array via REST.
Definition: rest_array.h:36
Thread aspect to access to BlackBoard.
Definition: blackboard.h:34
Thread aspect that allows to obtain the current time from the clock.
Definition: clock.h:34
Thread aspect to log output.
Definition: logging.h:33
SkillerDebugInterface Fawkes BlackBoard Interface.
SkillerInterface Fawkes BlackBoard Interface.
Thread class encapsulation of pthreads.
Definition: thread.h:46
Thread aspect to provide web pages via Webview.
Definition: webview.h:37
Webview REST API component.
Definition: rest_api.h:221
REST parameters to pass to handlers.
Definition: rest_api.h:125
Fawkes library namespace.