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()) {
Webview REST API component.
WebviewRestApiManager()
Constructor.
Fawkes library namespace.
const std::string & name() const
Get name of component.
WebviewRestApi * get_api(std::string &name)
Find API by name.
void unregister_api(WebviewRestApi *api)
Remove a request processor.
void register_api(WebviewRestApi *api)
Add a REST API.
~WebviewRestApiManager()
Destructor.
Base class for exceptions in Fawkes.
Mutex & mutex()
Get internal mutex.
Mutex mutual exclusion lock.