OpenCPN Partial API docs
Loading...
Searching...
No Matches
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.
 
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 240 of file rest_server.h.

Constructor & Destructor Documentation

◆ RestServer()

RestServer::RestServer ( RestServerDlgCtx  ctx,
RouteCtx  route_ctx,
bool &  portable 
)

Definition at line 445 of file rest_server.cpp.

◆ ~RestServer()

RestServer::~RestServer ( )
override

Definition at line 459 of file rest_server.cpp.

Member Function Documentation

◆ GetEndpoint()

std::string RestServer::GetEndpoint ( )
inlineoverridevirtual

Return HTTPS url to local rest server.

Implements AbstractRestServer.

Definition at line 255 of file rest_server.h.

◆ GetReturnStatus()

RestServerResult RestServer::GetReturnStatus ( )
inline

IoThread interface.

Definition at line 261 of file rest_server.h.

◆ StartServer()

bool RestServer::StartServer ( const fs::path &  certificate_location)
overridevirtual

Start the server thread.

Implements AbstractRestServer.

Definition at line 461 of file rest_server.cpp.

◆ StopServer()

void RestServer::StopServer ( )
overridevirtual

Stop server thread, blocks until completed.

Implements AbstractRestServer.

Definition at line 474 of file rest_server.cpp.

◆ UpdateReturnStatus()

void RestServer::UpdateReturnStatus ( RestServerResult  r)

IoThread interface.

Definition at line 437 of file rest_server.cpp.

◆ UpdateRouteMgr()

void RestServer::UpdateRouteMgr ( ) const
inline

IoThread interface.

Definition at line 264 of file rest_server.h.

Friends And Related Symbol Documentation

◆ RestCheckWriteApp

friend class RestCheckWriteApp
friend

Unit test hook.

Definition at line 242 of file rest_server.h.

◆ RestPluginMsgApp

friend class RestPluginMsgApp
friend

Unit test hook.

Definition at line 244 of file rest_server.h.

◆ RestServerObjectApp

friend class RestServerObjectApp
friend

Unit test hook.

Definition at line 241 of file rest_server.h.

◆ RestServerPingApp

friend class RestServerPingApp
friend

Unit test hook.

Definition at line 243 of file rest_server.h.

Member Data Documentation

◆ m_cert_file

std::string RestServer::m_cert_file

Semi-static storage used by IoThread C code.

Definition at line 267 of file rest_server.h.

◆ m_endpoint

const std::string RestServer::m_endpoint

Definition at line 287 of file rest_server.h.

◆ 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 285 of file rest_server.h.

◆ m_key_file

std::string RestServer::m_key_file

Semi-static storage used by IoThread C code.

Definition at line 270 of file rest_server.h.

◆ m_reply_body

std::string RestServer::m_reply_body

IoThread interface: body of return message, if any.

Definition at line 273 of file rest_server.h.

◆ ret_mutex

std::mutex RestServer::ret_mutex

IoThread interface: Guards return_status.

Definition at line 276 of file rest_server.h.

◆ return_status_cv

std::condition_variable RestServer::return_status_cv

IoThread interface: Guards return_status.

Definition at line 279 of file rest_server.h.


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