#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()> |
Public Member Functions | |
| HttpServer () | |
| ~HttpServer () | |
| absl::Status | Start (int port) |
| 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 |
| BonjourPublisher | bonjour_ |
| SymbolProviderSource | symbol_source_ |
| RenderServiceSource | render_source_ |
| RomSource | rom_source_ |
| ProjectPathSource | project_path_source_ |
| WindowAction | window_show_ |
| WindowAction | window_hide_ |
Definition at line 37 of file http_server.h.
| using yaze::cli::api::HttpServer::SymbolProviderSource = std::function<emu::debug::SymbolProvider*()> |
Definition at line 39 of file http_server.h.
| using yaze::cli::api::HttpServer::RenderServiceSource = std::function<app::service::RenderService*()> |
Definition at line 40 of file http_server.h.
| using yaze::cli::api::HttpServer::RomSource = std::function<Rom*()> |
Definition at line 41 of file http_server.h.
| using yaze::cli::api::HttpServer::ProjectPathSource = std::function<std::string()> |
Definition at line 42 of file http_server.h.
| using yaze::cli::api::HttpServer::WindowAction = std::function<bool()> |
Definition at line 43 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().

| absl::Status yaze::cli::api::HttpServer::Start | ( | int | port | ) |
Definition at line 20 of file http_server.cc.
References bonjour_, 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_.
| void yaze::cli::api::HttpServer::Stop | ( | ) |
Definition at line 59 of file http_server.cc.
References bonjour_, is_running_, LOG_INFO, server_, server_thread_, and yaze::cli::api::BonjourPublisher::Unpublish().
Referenced by ~HttpServer().

| bool yaze::cli::api::HttpServer::IsRunning | ( | ) | const |
Definition at line 72 of file http_server.cc.
References is_running_.
|
inline |
Definition at line 58 of file http_server.h.
References symbol_source_.
|
inline |
Definition at line 63 of file http_server.h.
References render_source_.
|
inline |
Definition at line 68 of file http_server.h.
References rom_source_.
|
inline |
Definition at line 71 of file http_server.h.
References project_path_source_.
|
inline |
|
inline |
Definition at line 79 of file http_server.h.
References window_hide_, and window_show_.
|
inline |
Definition at line 85 of file http_server.h.
References symbol_source_.
|
inline |
Definition at line 88 of file http_server.h.
References bonjour_.
|
private |
|
private |
Definition at line 76 of file http_server.cc.
References yaze::cli::api::ApplyCorsHeaders(), bonjour_, 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::HandleCommandList(), yaze::cli::api::HandleCorsPreflight(), 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 94 of file http_server.h.
Referenced by RegisterRoutes(), Start(), and Stop().
|
private |
Definition at line 95 of file http_server.h.
|
private |
Definition at line 96 of file http_server.h.
Referenced by IsRunning(), Start(), and Stop().
|
private |
Definition at line 97 of file http_server.h.
|
private |
Definition at line 98 of file http_server.h.
Referenced by GetBonjourPublisher(), RegisterRoutes(), Start(), and Stop().
|
private |
Definition at line 99 of file http_server.h.
Referenced by GetSymbolSource(), RegisterRoutes(), and SetSymbolProviderSource().
|
private |
Definition at line 100 of file http_server.h.
Referenced by RegisterRoutes(), and SetRenderServiceSource().
|
private |
Definition at line 101 of file http_server.h.
Referenced by RegisterRoutes(), and SetRomSource().
|
private |
Definition at line 102 of file http_server.h.
Referenced by RegisterRoutes(), and SetProjectPathSource().
|
private |
Definition at line 103 of file http_server.h.
Referenced by RegisterRoutes(), and SetWindowActions().
|
private |
Definition at line 104 of file http_server.h.
Referenced by RegisterRoutes(), and SetWindowActions().