Fawkes API
Fawkes Development Version
|
Manage URL mappings. More...
#include <>>
Public Member Functions | |
WebviewRestApiManager () | |
Constructor. More... | |
~WebviewRestApiManager () | |
Destructor. More... | |
void | register_api (WebviewRestApi *api) |
Add a REST API. More... | |
void | unregister_api (WebviewRestApi *api) |
Remove a request processor. More... | |
WebviewRestApi * | get_api (std::string &name) |
Find API by name. More... | |
Mutex & | mutex () |
Get internal mutex. More... | |
Manage URL mappings.
This class maps (base) URLs to web request processors which handle all requests for the given URL.
Definition at line 36 of file rest_api_manager.h.
fawkes::WebviewRestApiManager::WebviewRestApiManager | ( | ) |
Constructor.
Definition at line 39 of file rest_api_manager.cpp.
fawkes::WebviewRestApiManager::~WebviewRestApiManager | ( | ) |
Destructor.
Definition at line 44 of file rest_api_manager.cpp.
WebviewRestApi * fawkes::WebviewRestApiManager::get_api | ( | std::string & | name | ) |
Find API by name.
This method determines if a processor has been registered for the URL. It is the callers duty to ensure that the mutex has been locked while searching and while using the found processor.
name | name of REST API to retrieve |
Definition at line 81 of file rest_api_manager.cpp.
Mutex & fawkes::WebviewRestApiManager::mutex | ( | ) |
Get internal mutex.
Use this mutex to guard find_processor() and a following invocation of a found processor against changes due to registering/unregistering of processors.
Definition at line 96 of file rest_api_manager.cpp.
void fawkes::WebviewRestApiManager::register_api | ( | WebviewRestApi * | api | ) |
Add a REST API.
api | REST api handler |
Exception | thrown if an API of that name has already been registered |
Definition at line 54 of file rest_api_manager.cpp.
References fawkes::WebviewRestApi::name().
Referenced by BackendInfoRestApi::init(), TransformsRestApi::init(), ConfigurationRestApi::init(), PluginRestApi::init(), ClipsRestApi::init(), SkillerRestApi::init(), BlackboardRestApi::init(), ClipsExecutiveRestApi::init(), and ImageRestApi::init().
void fawkes::WebviewRestApiManager::unregister_api | ( | WebviewRestApi * | api | ) |
Remove a request processor.
api | REST api handler |
Definition at line 67 of file rest_api_manager.cpp.
References fawkes::WebviewRestApi::name().
Referenced by BackendInfoRestApi::finalize(), TransformsRestApi::finalize(), ConfigurationRestApi::finalize(), PluginRestApi::finalize(), ClipsRestApi::finalize(), SkillerRestApi::finalize(), BlackboardRestApi::finalize(), ClipsExecutiveRestApi::finalize(), and ImageRestApi::finalize().