23#include <core/exception.h>
24#include <core/threading/mutex.h>
25#include <core/threading/mutex_locker.h>
26#include <webview/rest_api.h>
27#include <webview/rest_api_manager.h>
57 if (apis_.find(api->
name()) != apis_.end()) {
58 throw Exception(
"A REST API for %s has already been registered", api->
name().c_str());
60 apis_[api->
name()] = api;
70 apis_.erase(api->
name());
83 if (apis_.find(name) == apis_.end()) {
Base class for exceptions in Fawkes.
Mutex mutual exclusion lock.
void unregister_api(WebviewRestApi *api)
Remove a request processor.
~WebviewRestApiManager()
Destructor.
WebviewRestApi * get_api(std::string &name)
Find API by name.
void register_api(WebviewRestApi *api)
Add a REST API.
WebviewRestApiManager()
Constructor.
Mutex & mutex()
Get internal mutex.
Webview REST API component.
const std::string & name() const
Get name of component.
Fawkes library namespace.