Fawkes API Fawkes Development Version
rest_api_manager.h
1
2/***************************************************************************
3 * rest_api_manager.h - Webview REST API manager
4 *
5 * Created: Fri Mar 16 16:42:36 2018
6 * Copyright 2006-2018 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 _LIBS_WEBVIEW_REST_API_MANAGER_H_
24#define _LIBS_WEBVIEW_REST_API_MANAGER_H_
25
26#include <core/threading/mutex.h>
27
28#include <map>
29#include <string>
30
31namespace fawkes {
32
33class Mutex;
34class WebviewRestApi;
35
37{
38public:
41
44
45 WebviewRestApi *get_api(std::string &name);
46 Mutex & mutex();
47
48private:
49 Mutex mutex_;
50 std::map<std::string, WebviewRestApi *> apis_;
51};
52
53} // end namespace fawkes
54
55#endif
Mutex mutual exclusion lock.
Definition: mutex.h:33
void unregister_api(WebviewRestApi *api)
Remove a request processor.
WebviewRestApi * get_api(std::string &name)
Find API by name.
void register_api(WebviewRestApi *api)
Add a REST API.
Mutex & mutex()
Get internal mutex.
Webview REST API component.
Definition: rest_api.h:221
Fawkes library namespace.