#include <http_server.h>

Public Types | |
| using | SymbolProviderSource = std::function<emu::debug::SymbolProvider*()> |
| using | RenderServiceSource = std::function<app::service::RenderService*()> |
| using | RomSource = std::function<Rom*()> |
| using | ProjectPathSource = std::function<std::string()> |
| using | WindowAction = std::function<bool()> |
| using | EditorControl |
Public Member Functions | |
| void | SetEditorControl (EditorControl control) |
| HttpServer () | |
| ~HttpServer () | |
| absl::Status | Start (int port, bool loopback_only=false) |
| void | SetBindAddress (std::string address) |
| void | SetCommandExecutionEnabled (bool enabled) |
| void | Stop () |
| bool | IsRunning () const |
| void | SetSymbolProviderSource (SymbolProviderSource source) |
| void | SetRenderServiceSource (RenderServiceSource source) |
| void | SetRomSource (RomSource source) |
| void | SetProjectPathSource (ProjectPathSource source) |
| int | port () const |
| void | SetWindowActions (WindowAction show, WindowAction hide) |
| SymbolProviderSource | GetSymbolSource () const |
| BonjourPublisher & | GetBonjourPublisher () |
Private Member Functions | |
| void | RunServer (int port) |
| void | RegisterRoutes () |
Private Attributes | |
| std::unique_ptr< httplib::Server > | server_ |
| std::unique_ptr< std::thread > | server_thread_ |
| std::atomic< bool > | is_running_ {false} |
| int | port_ = 0 |
| bool | editor_control_only_ = false |
| std::string | bind_address_ = "0.0.0.0" |
| bool | command_execution_enabled_ = true |
| BonjourPublisher | bonjour_ |
| SymbolProviderSource | symbol_source_ |
| RenderServiceSource | render_source_ |
| RomSource | rom_source_ |
| ProjectPathSource | project_path_source_ |
| WindowAction | window_show_ |
| WindowAction | window_hide_ |
| EditorControl | editor_control_ |
Definition at line 38 of file http_server.h.
| using yaze::cli::api::HttpServer::SymbolProviderSource = std::function<emu::debug::SymbolProvider*()> |
Definition at line 40 of file http_server.h.
| using yaze::cli::api::HttpServer::RenderServiceSource = std::function<app::service::RenderService*()> |
Definition at line 41 of file http_server.h.
| using yaze::cli::api::HttpServer::RomSource = std::function<Rom*()> |
Definition at line 42 of file http_server.h.
| using yaze::cli::api::HttpServer::ProjectPathSource = std::function<std::string()> |
Definition at line 43 of file http_server.h.
| using yaze::cli::api::HttpServer::WindowAction = std::function<bool()> |
Definition at line 44 of file http_server.h.
Definition at line 45 of file http_server.h.
| yaze::cli::api::HttpServer::HttpServer | ( | ) |
Definition at line 14 of file http_server.cc.
| yaze::cli::api::HttpServer::~HttpServer | ( | ) |
Definition at line 16 of file http_server.cc.
References Stop().

|
inline |
Definition at line 47 of file http_server.h.
References editor_control_.
| absl::Status yaze::cli::api::HttpServer::Start | ( | int | port, |
| bool | loopback_only = false ) |
Definition at line 20 of file http_server.cc.
References bind_address_, bonjour_, editor_control_, editor_control_only_, is_running_, yaze::cli::api::BonjourPublisher::IsAvailable(), yaze::cli::api::BonjourPublisher::IsPublished(), LOG_ERROR, LOG_INFO, port(), port_, yaze::cli::api::BonjourPublisher::Publish(), RegisterRoutes(), server_, and server_thread_.
|
inline |
Definition at line 59 of file http_server.h.
References bind_address_.
|
inline |
Definition at line 65 of file http_server.h.
References command_execution_enabled_.
| void yaze::cli::api::HttpServer::Stop | ( | ) |
Definition at line 68 of file http_server.cc.
References bonjour_, is_running_, server_, server_thread_, and yaze::cli::api::BonjourPublisher::Unpublish().
Referenced by ~HttpServer().

| bool yaze::cli::api::HttpServer::IsRunning | ( | ) | const |
Definition at line 77 of file http_server.cc.
References is_running_.
|
inline |
Definition at line 76 of file http_server.h.
References symbol_source_.
|
inline |
Definition at line 81 of file http_server.h.
References render_source_.
|
inline |
Definition at line 86 of file http_server.h.
References rom_source_.
|
inline |
Definition at line 89 of file http_server.h.
References project_path_source_.
|
inline |
|
inline |
Definition at line 97 of file http_server.h.
References window_hide_, and window_show_.
|
inline |
Definition at line 103 of file http_server.h.
References symbol_source_.
|
inline |
Definition at line 106 of file http_server.h.
References bonjour_.
|
private |
|
private |
Definition at line 81 of file http_server.cc.
References yaze::cli::api::ApplyCorsHeaders(), bonjour_, command_execution_enabled_, editor_control_, editor_control_only_, yaze::cli::api::HandleAnnotationCreate(), yaze::cli::api::HandleAnnotationDelete(), yaze::cli::api::HandleAnnotationList(), yaze::cli::api::HandleAnnotationUpdate(), yaze::cli::api::HandleBreakpointHit(), yaze::cli::api::HandleCommandExecute(), yaze::cli::api::HandleCommandExecuteDisabled(), yaze::cli::api::HandleCommandList(), yaze::cli::api::HandleCorsPreflight(), yaze::cli::api::HandleEditorControl(), yaze::cli::api::HandleGetSymbols(), yaze::cli::api::HandleHealth(), yaze::cli::api::HandleListModels(), yaze::cli::api::HandleNavigate(), yaze::cli::api::HandleRenderDungeon(), yaze::cli::api::HandleRenderDungeonMetadata(), yaze::cli::api::HandleStateUpdate(), yaze::cli::api::HandleWindowHide(), yaze::cli::api::HandleWindowShow(), project_path_source_, render_source_, rom_source_, server_, symbol_source_, window_hide_, and window_show_.
Referenced by Start().
|
private |
Definition at line 112 of file http_server.h.
Referenced by RegisterRoutes(), Start(), and Stop().
|
private |
Definition at line 113 of file http_server.h.
|
private |
Definition at line 114 of file http_server.h.
Referenced by IsRunning(), Start(), and Stop().
|
private |
Definition at line 115 of file http_server.h.
|
private |
Definition at line 116 of file http_server.h.
Referenced by RegisterRoutes(), and Start().
|
private |
Definition at line 117 of file http_server.h.
Referenced by SetBindAddress(), and Start().
|
private |
Definition at line 118 of file http_server.h.
Referenced by RegisterRoutes(), and SetCommandExecutionEnabled().
|
private |
Definition at line 119 of file http_server.h.
Referenced by GetBonjourPublisher(), RegisterRoutes(), Start(), and Stop().
|
private |
Definition at line 120 of file http_server.h.
Referenced by GetSymbolSource(), RegisterRoutes(), and SetSymbolProviderSource().
|
private |
Definition at line 121 of file http_server.h.
Referenced by RegisterRoutes(), and SetRenderServiceSource().
|
private |
Definition at line 122 of file http_server.h.
Referenced by RegisterRoutes(), and SetRomSource().
|
private |
Definition at line 123 of file http_server.h.
Referenced by RegisterRoutes(), and SetProjectPathSource().
|
private |
Definition at line 124 of file http_server.h.
Referenced by RegisterRoutes(), and SetWindowActions().
|
private |
Definition at line 125 of file http_server.h.
Referenced by RegisterRoutes(), and SetWindowActions().
|
private |
Definition at line 126 of file http_server.h.
Referenced by RegisterRoutes(), SetEditorControl(), and Start().