CARLA
Public Member Functions | Private Types | Private Attributes | List of all members
carla::streaming::Server Class Reference

A streaming server. More...

#include <Server.h>

+ Collaboration diagram for carla::streaming::Server:

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)
 
auto GetLocalEndpoint () const
 
token_type GetToken (stream_id sensor_id)
 
bool IsEnabledForROS (stream_id sensor_id)
 
Stream MakeStream ()
 
void Run ()
 
 Server (uint16_t port)
 
 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)
 
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 21 of file streaming/Server.h.

Member Typedef Documentation

◆ protocol_type

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

◆ stream_id

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

◆ token_type

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

◆ underlying_server

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

Constructor & Destructor Documentation

◆ Server() [1/3]

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

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

◆ Server() [2/3]

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

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

◆ 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 34 of file streaming/Server.h.

◆ ~Server()

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

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

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

+ Here is the call graph for this function:

Member Function Documentation

◆ AsyncRun()

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

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

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

+ Here is the call graph for this function:

◆ CloseStream()

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

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

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

+ Here is the call graph for this function:

◆ DisableForROS()

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

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

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

Referenced by FCarlaServer::FPimpl::BindActions(), and FCarlaEngine::NotifyInitGame().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ EnableForROS()

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

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

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

Referenced by FCarlaServer::FPimpl::BindActions(), and FCarlaEngine::NotifyInitGame().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetLocalEndpoint()

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

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

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

+ Here is the call graph for this function:

◆ GetToken()

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

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

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

Referenced by FCarlaServer::FPimpl::BindActions(), and FCarlaEngine::NotifyInitGame().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ IsEnabledForROS()

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

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

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

Referenced by FCarlaServer::FPimpl::BindActions(), and FCarlaEngine::NotifyInitGame().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MakeStream()

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

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

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

+ Here is the call graph for this function:

◆ Run()

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

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

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

+ Here is the call graph for this function:

◆ SetSynchronousMode()

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

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

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

Referenced by FCarlaServer::FPimpl::BindActions().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetTimeout()

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

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

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

+ Here is the call graph for this function:

Member Data Documentation

◆ _pool

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

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

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

◆ _server

underlying_server carla::streaming::Server::_server
private

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