$darkmode
engine::Server Class Referenceabstract

#include <server.hpp>

Inheritance diagram for engine::Server:

Public Member Functions

 Server (const Server &)=default
 
 Server (Server &&)=delete
 
Serveroperator= (const Server &)=default
 
Serveroperator= (Server &&)=delete
 
 Server (cloe::ServerConf config)
 
const cloe::ServerConf & config () const
 
virtual bool is_listening () const =0
 
virtual bool is_streaming () const =0
 
virtual void start ()=0
 
virtual void stop ()=0
 
virtual void init_stream (const std::string &filename)=0
 
virtual void enroll (cloe::Registrar &r)=0
 
virtual std::unique_ptr< ServerRegistrarserver_registrar ()=0
 
virtual void refresh_buffer_start_stream ()=0
 
virtual void refresh_buffer ()=0
 
virtual std::vector< std::string > endpoints () const =0
 
virtual Defer lock ()=0
 

Protected Member Functions

cloe::Logger logger () const
 

Protected Attributes

cloe::ServerConf config_
 

Detailed Description

Server interface to make altering the implementation easier.

Use make_server() to create an instance that you can use.

Member Function Documentation

◆ config()

const cloe::ServerConf& engine::Server::config ( ) const
inline

Return the server configuration.

◆ endpoints()

virtual std::vector<std::string> engine::Server::endpoints ( ) const
pure virtual

Return a list of all registered endpoints.

Implemented in engine::ServerImpl, and engine::ServerImpl.

◆ enroll()

virtual void engine::Server::enroll ( cloe::Registrar r)
pure virtual

Register a list of all endpoints.

Implemented in engine::ServerImpl, and engine::ServerImpl.

◆ init_stream()

virtual void engine::Server::init_stream ( const std::string &  filename)
pure virtual

Open a file for api data streaming. This does not require a running web server.

Implemented in engine::ServerImpl, and engine::ServerImpl.

◆ is_listening()

virtual bool engine::Server::is_listening ( ) const
pure virtual

Return whether the server is alive and listening for requests.

Implemented in engine::ServerImpl, and engine::ServerImpl.

◆ is_streaming()

virtual bool engine::Server::is_streaming ( ) const
pure virtual

Return whether the server is currently streaming buffer data to a file.

If it is, expect performance to be bad.

Implemented in engine::ServerImpl, and engine::ServerImpl.

◆ lock()

virtual Defer engine::Server::lock ( )
pure virtual

Return a write lock guard on the server.

Keep the returned value alive for as long as the server should be locked. Once the destructor is called, the lock is released.

Returns
Lock guard

Implemented in engine::ServerImpl, and engine::ServerImpl.

◆ refresh_buffer()

virtual void engine::Server::refresh_buffer ( )
pure virtual

Refresh and/or write api data to a file.

Implemented in engine::ServerImpl, and engine::ServerImpl.

◆ refresh_buffer_start_stream()

virtual void engine::Server::refresh_buffer_start_stream ( )
pure virtual

Refresh and/or start streaming api data to a file.

Implemented in engine::ServerImpl, and engine::ServerImpl.

◆ server_registrar()

virtual std::unique_ptr<ServerRegistrar> engine::Server::server_registrar ( )
pure virtual

Return a new ServerRegistrar that lets you register static content and API endpoints with the web server.

Implemented in engine::ServerImpl, and engine::ServerImpl.

◆ start()

virtual void engine::Server::start ( )
pure virtual

Start the web server.

Implemented in engine::ServerImpl, and engine::ServerImpl.

◆ stop()

virtual void engine::Server::stop ( )
pure virtual

Stop all server-related procedures.

Implemented in engine::ServerImpl, and engine::ServerImpl.


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