TraceMaker
C++ API of the engine
Loading...
Searching...
No Matches
tmk::server::ViewerServer Class Referencefinal

#include <server/viewer_server.hpp>

Inheritance diagram for tmk::server::ViewerServer:
tmk::events::Sink

Classes

struct  Counters

Public Member Functions

 ViewerServer (ServerOptions opts={})
 Binds and starts the I/O thread. Throws std::runtime_error if the address cannot be bound.
 ~ViewerServer () override
 ViewerServer (const ViewerServer &)=delete
ViewerServer & operator= (const ViewerServer &)=delete
void publish (std::string json) override
 One JSON object per message (see the protocol document for the message types).
bool wants_transient () const override
 True while at least one viewer is connected, so producers can skip building transient messages.
std::uint16_t port () const
 bound port (useful with port 0)
std::string url () const
 http://<host or a LAN address>:<port>/ , with ?token=... when the viewer needs one
const std::string & token () const
 "" = none required
bool exposed () const
 bound to an address other machines can reach
std::string notice () const
 What to tell the user when the viewer is reachable from the network ("" when it is not): who can see it and what protects it.
std::size_t client_count () const
const std::string & web_root () const
Counters counters () const
Public Member Functions inherited from tmk::events::Sink
virtual ~Sink ()=default

Detailed Description

Definition at line 41 of file viewer_server.hpp.

Constructor & Destructor Documentation

◆ ViewerServer() [1/2]

tmk::server::ViewerServer::ViewerServer ( ServerOptions opts = {})
explicit

Binds and starts the I/O thread. Throws std::runtime_error if the address cannot be bound.

◆ ~ViewerServer()

tmk::server::ViewerServer::~ViewerServer ( )
override

◆ ViewerServer() [2/2]

tmk::server::ViewerServer::ViewerServer ( const ViewerServer & )
delete

Member Function Documentation

◆ client_count()

std::size_t tmk::server::ViewerServer::client_count ( ) const

◆ counters()

Counters tmk::server::ViewerServer::counters ( ) const

◆ exposed()

bool tmk::server::ViewerServer::exposed ( ) const

bound to an address other machines can reach

◆ notice()

std::string tmk::server::ViewerServer::notice ( ) const

What to tell the user when the viewer is reachable from the network ("" when it is not): who can see it and what protects it.

◆ operator=()

ViewerServer & tmk::server::ViewerServer::operator= ( const ViewerServer & )
delete

◆ port()

std::uint16_t tmk::server::ViewerServer::port ( ) const

bound port (useful with port 0)

◆ publish()

void tmk::server::ViewerServer::publish ( std::string json)
overridevirtual

One JSON object per message (see the protocol document for the message types).

Implements tmk::events::Sink.

◆ token()

const std::string & tmk::server::ViewerServer::token ( ) const

"" = none required

◆ url()

std::string tmk::server::ViewerServer::url ( ) const

http://<host or a LAN address>:<port>/ , with ?token=... when the viewer needs one

◆ wants_transient()

bool tmk::server::ViewerServer::wants_transient ( ) const
overridevirtual

True while at least one viewer is connected, so producers can skip building transient messages.

Reimplemented from tmk::events::Sink.

◆ web_root()

const std::string & tmk::server::ViewerServer::web_root ( ) const

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