ReUseX  0.0.5
3D Point Cloud Processing for Building Reuse
Loading...
Searching...
No Matches
rux::gui::Server Class Reference

Crow-backed implementation of the GUI API contract. More...

#include <Server.hpp>

Public Member Functions

 Server (ServerOptions options)
 Opens the project read-write once (creating/migrating it if needed), then constructs the job runner and registers every route.
 ~Server ()
 Server (const Server &)=delete
Serveroperator= (const Server &)=delete
const ServerOptionsoptions () const noexcept
 The resolved options, with asset_dir filled in by the search order.
std::string url () const
 Where the server can be reached, e.g. "http://127.0.0.1:8420".
bool has_assets () const noexcept
 True when a frontend bundle was found; false when the placeholder page is being served instead.
int run ()
 Serve until SIGINT/SIGTERM or stop(). Returns a process exit code.
void stop ()
 Ask a running server to shut down, unblocking run().

Detailed Description

Crow-backed implementation of the GUI API contract.

Definition at line 59 of file Server.hpp.

Constructor & Destructor Documentation

◆ Server() [1/2]

rux::gui::Server::Server ( ServerOptions options)
explicit

Opens the project read-write once (creating/migrating it if needed), then constructs the job runner and registers every route.

Exceptions
std::runtime_errorif the project cannot be opened or the options are invalid.

References options().

Referenced by operator=(), and Server().

◆ ~Server()

rux::gui::Server::~Server ( )

◆ Server() [2/2]

rux::gui::Server::Server ( const Server & )
delete

References Server().

Member Function Documentation

◆ has_assets()

bool rux::gui::Server::has_assets ( ) const
noexcept

True when a frontend bundle was found; false when the placeholder page is being served instead.

References has_assets().

Referenced by has_assets().

◆ operator=()

Server & rux::gui::Server::operator= ( const Server & )
delete

References Server().

◆ options()

const ServerOptions & rux::gui::Server::options ( ) const
noexcept

The resolved options, with asset_dir filled in by the search order.

Referenced by Server().

◆ run()

int rux::gui::Server::run ( )

Serve until SIGINT/SIGTERM or stop(). Returns a process exit code.

References run().

Referenced by run().

◆ stop()

void rux::gui::Server::stop ( )

Ask a running server to shut down, unblocking run().

rux gui itself relies on Crow's own signal handling, so this exists for callers that drive run() on a thread — chiefly the socket-level tests, which need a real listening server and then need it to go away again. Safe to call from another thread; join the thread running run() before destroying the Server.

References stop().

Referenced by stop().

◆ url()

std::string rux::gui::Server::url ( ) const

Where the server can be reached, e.g. "http://127.0.0.1:8420".

References url().

Referenced by url().


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