CARLA
Loading...
Searching...
No Matches
carla::streaming::Server Class Reference

A streaming server. More...

#include <Server.h>

Public Member Functions

void AsyncRun (size_t worker_threads)
void CloseStream (carla::streaming::detail::stream_id_type id)
void DisableForROS (stream_id sensor_id)
void EnableForROS (stream_id sensor_id)
std::optional< stream_id > FindStreamAlias (stream_id alias)
std::optional< token_type > FindToken (stream_id id)
 Token of an existing stream, or std::nullopt if id is unknown.
auto GetLocalEndpoint () const
token_type GetToken (stream_id sensor_id)
bool IsEnabledForROS (stream_id sensor_id)
Stream MakeStream ()
void RemoveStreamAlias (stream_id alias)
void Run ()
 Server (const std::string &address, uint16_t port)
 Server (const std::string &address, uint16_t port, const std::string &external_address, uint16_t external_port)
 Server (uint16_t port)
void SetROS2TopicVisibilityDefaultEnabled (bool enabled)
void SetSessionsUseStreamAliases (bool enabled)
void SetStreamAlias (stream_id alias, stream_id target)
void SetSynchronousMode (bool is_synchro)
void SetTimeout (time_duration timeout)
 ~Server ()

Private Types

using protocol_type = low_level::Server<detail::tcp::Server>::protocol_type
using stream_id = carla::streaming::detail::stream_id_type
using token_type = carla::streaming::detail::token_type
using underlying_server = low_level::Server<detail::tcp::Server>

Private Attributes

ThreadPool _pool
underlying_server _server

Detailed Description

A streaming server.

Each new stream has a token associated, this token can be used by a client to subscribe to the stream.

Definition at line 23 of file streaming/Server.h.

Member Typedef Documentation

◆ protocol_type

Definition at line 25 of file streaming/Server.h.

◆ stream_id

◆ token_type

◆ underlying_server

Constructor & Destructor Documentation

◆ Server() [1/3]

carla::streaming::Server::Server ( uint16_t port)
inlineexplicit

Definition at line 30 of file streaming/Server.h.

References _pool, and _server.

◆ Server() [2/3]

carla::streaming::Server::Server ( const std::string & address,
uint16_t port )
inlineexplicit

Definition at line 33 of file streaming/Server.h.

References _pool, and _server.

◆ Server() [3/3]

carla::streaming::Server::Server ( const std::string & address,
uint16_t port,
const std::string & external_address,
uint16_t external_port )
inlineexplicit

Definition at line 36 of file streaming/Server.h.

References _pool, and _server.

◆ ~Server()

carla::streaming::Server::~Server ( )
inline

Definition at line 44 of file streaming/Server.h.

References _pool, and carla::ThreadPool::Stop().

Member Function Documentation

◆ AsyncRun()

void carla::streaming::Server::AsyncRun ( size_t worker_threads)
inline

Definition at line 68 of file streaming/Server.h.

References _pool, and carla::ThreadPool::AsyncRun().

Referenced by TEST(), TEST(), and TEST().

◆ CloseStream()

void carla::streaming::Server::CloseStream ( carla::streaming::detail::stream_id_type id)
inline

◆ DisableForROS()

void carla::streaming::Server::DisableForROS ( stream_id sensor_id)
inline

◆ EnableForROS()

void carla::streaming::Server::EnableForROS ( stream_id sensor_id)
inline

◆ FindStreamAlias()

std::optional< stream_id > carla::streaming::Server::FindStreamAlias ( stream_id alias)
inlinenodiscard

◆ FindToken()

std::optional< token_type > carla::streaming::Server::FindToken ( stream_id id)
inlinenodiscard

Token of an existing stream, or std::nullopt if id is unknown.

Definition at line 82 of file streaming/Server.h.

References _server, and carla::streaming::low_level::Server< T >::FindToken().

Referenced by TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().

◆ GetLocalEndpoint()

auto carla::streaming::Server::GetLocalEndpoint ( ) const
inline

Definition at line 48 of file streaming/Server.h.

References _server, and carla::streaming::low_level::Server< T >::GetLocalEndpoint().

Referenced by TEST().

◆ GetToken()

token_type carla::streaming::Server::GetToken ( stream_id sensor_id)
inline

◆ IsEnabledForROS()

bool carla::streaming::Server::IsEnabledForROS ( stream_id sensor_id)
inline

◆ MakeStream()

Stream carla::streaming::Server::MakeStream ( )
inline

◆ RemoveStreamAlias()

void carla::streaming::Server::RemoveStreamAlias ( stream_id alias)
inline

◆ Run()

void carla::streaming::Server::Run ( )
inline

Definition at line 64 of file streaming/Server.h.

References _pool, and carla::ThreadPool::Run().

◆ SetROS2TopicVisibilityDefaultEnabled()

void carla::streaming::Server::SetROS2TopicVisibilityDefaultEnabled ( bool enabled)
inline

◆ SetSessionsUseStreamAliases()

void carla::streaming::Server::SetSessionsUseStreamAliases ( bool enabled)
inline

◆ SetStreamAlias()

void carla::streaming::Server::SetStreamAlias ( stream_id alias,
stream_id target )
inline

◆ SetSynchronousMode()

void carla::streaming::Server::SetSynchronousMode ( bool is_synchro)
inline

◆ SetTimeout()

void carla::streaming::Server::SetTimeout ( time_duration timeout)
inline

Definition at line 52 of file streaming/Server.h.

References _server, and carla::streaming::low_level::Server< T >::SetTimeout().

Referenced by TEST().

Member Data Documentation

◆ _pool

ThreadPool carla::streaming::Server::_pool
private

Definition at line 123 of file streaming/Server.h.

Referenced by AsyncRun(), Run(), Server(), Server(), Server(), and ~Server().

◆ _server


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