Fawkes API  Fawkes Development Version
fawkes::WebviewRestApiManager Class Reference

#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 42 of file rest_api_manager.h.

Constructor & Destructor Documentation

◆ WebviewRestApiManager()

fawkes::WebviewRestApiManager::WebviewRestApiManager ( )

Constructor.

Definition at line 45 of file rest_api_manager.cpp.

◆ ~WebviewRestApiManager()

fawkes::WebviewRestApiManager::~WebviewRestApiManager ( )

Destructor.

Definition at line 50 of file rest_api_manager.cpp.

References fawkes::WebviewRestApi::name().

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 87 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 102 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 60 of file rest_api_manager.cpp.

Referenced by BackendInfoRestApi::init(), ClipsRestApi::init(), TransformsRestApi::init(), ConfigurationRestApi::init(), SkillerRestApi::init(), PluginRestApi::init(), ClipsExecutiveRestApi::init(), ImageRestApi::init(), and BlackboardRestApi::init().

◆ unregister_api()


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