Fawkes API  Fawkes Development Version
fawkes::WebUrlManager Class Reference

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...
 
WebRequestProcessorfind_processor (std::string &url) const
 Lock mutex and find processor. More...
 
Mutexmutex ()
 Get internal mutex. More...
 

Detailed Description

Manage URL mappings.

This class maps (base) URLs to web request processors which handle all requests for the given URL.

Author
Tim Niemueller

Definition at line 37 of file url_manager.h.

Constructor & Destructor Documentation

◆ WebUrlManager()

fawkes::WebUrlManager::WebUrlManager ( )

Constructor.

Definition at line 43 of file url_manager.cpp.

◆ ~WebUrlManager()

fawkes::WebUrlManager::~WebUrlManager ( )

Destructor.

Definition at line 51 of file url_manager.cpp.

Member Function Documentation

◆ find_processor()

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.

Parameters
urlurl to get the processor for
Returns
request processor if found, NULL otherwise

Definition at line 105 of file url_manager.cpp.

Referenced by fawkes::dynamic_reply_free_cb().

◆ mutex()

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.

Returns
internal mutex

Definition at line 134 of file url_manager.cpp.

Referenced by fawkes::dynamic_reply_free_cb().

◆ register_baseurl()

void fawkes::WebUrlManager::register_baseurl ( const char *  url_prefix,
WebRequestProcessor processor 
)

Add a request processor.

Parameters
url_prefixbaseurl this processor should handle
processorprocessor for baseurl
Exceptions
Exceptionthrown 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().

◆ unregister_baseurl()

void fawkes::WebUrlManager::unregister_baseurl ( const char *  url_prefix)

Remove a request processor.

Parameters
url_prefixbaseurl 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().


The documentation for this class was generated from the following files: