OpenCPN Partial API docs
RestServer Class Reference

AbstractRestServer implementation and interface to underlying IO thread. More...

#include <rest_server.h>

Inheritance diagram for RestServer:
AbstractRestServer

Public Member Functions

 RestServer (RestServerDlgCtx ctx, RouteCtx route_ctx, bool &portable)
 
bool StartServer (const fs::path &certificate_location) override
 Start the server thread.
 
void StopServer () override
 Stop server thread, blocks until completed.
 
std::string GetEndpoint () override
 Return HTTPS url to local rest server.
 
void UpdateReturnStatus (RestServerResult r)
 IoThread interface.
 
RestServerResult GetReturnStatus ()
 IoThread interface.
 
void UpdateRouteMgr () const
 IoThread interface.
 

Public Attributes

std::string m_cert_file
 Semi-static storage used by IoThread C code.
 
std::string m_key_file
 Semi-static storage used by IoThread C code.
 
std::string m_reply_body
 IoThread interface: body of return message, if any.
 
std::mutex ret_mutex
 IoThread interface: Guards return_status.
 
std::condition_variable return_status_cv
 IoThread interface: Guards return_status.
 
wxSemaphore m_exit_sem
 IoThread interface: Binary exit synchronization, released when io thread exits. More...
 
const std::string m_endpoint
 
- Public Attributes inherited from AbstractRestServer
EventVar activate_route
 Notified with a string GUID when user wants to activate a route.
 
EventVar reverse_route
 Notified with a string GUID when user wants to reverse a route.
 

Friends

class RestServerObjectApp
 Unit test hook.
 
class RestCheckWriteApp
 Unit test hook.
 
class RestServerPingApp
 Unit test hook.
 
class RestPluginMsgApp
 Unit test hook.
 

Detailed Description

AbstractRestServer implementation and interface to underlying IO thread.

Definition at line 241 of file rest_server.h.

Member Data Documentation

◆ m_exit_sem

wxSemaphore RestServer::m_exit_sem

IoThread interface: Binary exit synchronization, released when io thread exits.

std::semaphore is C++20, hence wxSemaphore.

Definition at line 286 of file rest_server.h.


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