Fawkes API
Fawkes Development Version
|
Manage URL mappings. More...
#include <>>
Public Member Functions | |
WebUrlManager () | |
Constructor. More... | |
~WebUrlManager () | |
Destructor. More... | |
void | register_baseurl (const char *url_prefix, WebRequestProcessor *processor) |
Add a request processor. More... | |
void | unregister_baseurl (const char *url_prefix) |
Remove a request processor. More... | |
WebRequestProcessor * | find_processor (std::string &url) const |
Lock mutex and find processor. 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 37 of file url_manager.h.
fawkes::WebUrlManager::WebUrlManager | ( | ) |
Constructor.
Definition at line 43 of file url_manager.cpp.
fawkes::WebUrlManager::~WebUrlManager | ( | ) |
Destructor.
Definition at line 51 of file url_manager.cpp.
WebRequestProcessor * fawkes::WebUrlManager::find_processor | ( | std::string & | url | ) | const |
Lock mutex and find processor.
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.
url | url to get the processor for |
Definition at line 105 of file url_manager.cpp.
Referenced by fawkes::dynamic_reply_free_cb().
Mutex * fawkes::WebUrlManager::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 134 of file url_manager.cpp.
Referenced by fawkes::dynamic_reply_free_cb().
void fawkes::WebUrlManager::register_baseurl | ( | const char * | url_prefix, |
WebRequestProcessor * | processor | ||
) |
Add a request processor.
url_prefix | baseurl this processor should handle |
processor | processor for baseurl |
Exception | thrown if a processor has already been registered for the given URL prefix. |
Definition at line 64 of file url_manager.cpp.
Referenced by RRDWebThread::init(), ClipsWebviewThread::init(), WebviewPtzCamThread::init(), XmlRpcThread::init(), WebviewThread::init(), and ROSWebviewThread::loop().
void fawkes::WebUrlManager::unregister_baseurl | ( | const char * | url_prefix | ) |
Remove a request processor.
url_prefix | baseurl the processor handled |
Definition at line 87 of file url_manager.cpp.
Referenced by RRDWebThread::finalize(), ClipsWebviewThread::finalize(), WebviewPtzCamThread::finalize(), ROSWebviewThread::finalize(), XmlRpcThread::finalize(), WebviewThread::finalize(), and ROSWebviewThread::loop().