Fawkes API  Fawkes Development Version
fawkes::WebviewRestApiManager Class Reference

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...
 
WebviewRestApiget_api (std::string &name)
 Find API by name. 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 36 of file rest_api_manager.h.

Constructor & Destructor Documentation

◆ WebviewRestApiManager()

fawkes::WebviewRestApiManager::WebviewRestApiManager ( )

Constructor.

Definition at line 39 of file rest_api_manager.cpp.

◆ ~WebviewRestApiManager()

fawkes::WebviewRestApiManager::~WebviewRestApiManager ( )

Destructor.

Definition at line 44 of file rest_api_manager.cpp.

Member Function Documentation

◆ get_api()

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.

Parameters
namename of REST API to retrieve
Returns
request processor if found, NULL otherwise

Definition at line 81 of file rest_api_manager.cpp.

◆ mutex()

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.

Returns
internal mutex

Definition at line 96 of file rest_api_manager.cpp.

◆ register_api()

void fawkes::WebviewRestApiManager::register_api ( WebviewRestApi api)

Add a REST API.

Parameters
apiREST api handler
Exceptions
Exceptionthrown 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().

◆ unregister_api()


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