yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
yaze::cli::api::HttpServer Class Reference

#include <http_server.h>

Public Member Functions

 HttpServer ()
 
 ~HttpServer ()
 
absl::Status Start (int port)
 
void Stop ()
 
bool IsRunning () const
 

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}
 

Detailed Description

Definition at line 20 of file http_server.h.

Constructor & Destructor Documentation

◆ HttpServer()

yaze::cli::api::HttpServer::HttpServer ( )

Definition at line 16 of file http_server.cc.

◆ ~HttpServer()

yaze::cli::api::HttpServer::~HttpServer ( )

Definition at line 18 of file http_server.cc.

References Stop().

Here is the call graph for this function:

Member Function Documentation

◆ Start()

absl::Status yaze::cli::api::HttpServer::Start ( int port)

Definition at line 22 of file http_server.cc.

References is_running_, LOG_ERROR, LOG_INFO, RegisterRoutes(), server_, and server_thread_.

Here is the call graph for this function:

◆ Stop()

void yaze::cli::api::HttpServer::Stop ( )

Definition at line 51 of file http_server.cc.

References is_running_, LOG_INFO, server_, and server_thread_.

Referenced by ~HttpServer().

◆ IsRunning()

bool yaze::cli::api::HttpServer::IsRunning ( ) const

Definition at line 63 of file http_server.cc.

References is_running_.

◆ RunServer()

void yaze::cli::api::HttpServer::RunServer ( int port)
private

◆ RegisterRoutes()

void yaze::cli::api::HttpServer::RegisterRoutes ( )
private

Definition at line 67 of file http_server.cc.

References yaze::cli::api::HandleHealth(), yaze::cli::api::HandleListModels(), and server_.

Referenced by Start().

Here is the call graph for this function:

Member Data Documentation

◆ server_

std::unique_ptr<httplib::Server> yaze::cli::api::HttpServer::server_
private

Definition at line 38 of file http_server.h.

Referenced by RegisterRoutes(), Start(), and Stop().

◆ server_thread_

std::unique_ptr<std::thread> yaze::cli::api::HttpServer::server_thread_
private

Definition at line 39 of file http_server.h.

Referenced by Start(), and Stop().

◆ is_running_

std::atomic<bool> yaze::cli::api::HttpServer::is_running_ {false}
private

Definition at line 40 of file http_server.h.

Referenced by IsRunning(), Start(), and Stop().


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