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

A client able to subscribe to multiple streams. More...

#include <Client.h>

+ Collaboration diagram for carla::streaming::Client:

Public Member Functions

void AsyncRun (size_t worker_threads)
 
 Client ()=default
 
 Client (const std::string &fallback_address)
 
void Run ()
 
template<typename Functor >
void Subscribe (const Token &token, Functor &&callback)
 
void UnSubscribe (const Token &token)
 
 ~Client ()
 

Private Types

using underlying_client = low_level::Client< detail::tcp::Client >
 

Private Attributes

underlying_client _client
 
ThreadPool _service
 

Detailed Description

A client able to subscribe to multiple streams.

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

Member Typedef Documentation

◆ underlying_client

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

Constructor & Destructor Documentation

◆ Client() [1/2]

carla::streaming::Client::Client ( )
default

◆ Client() [2/2]

carla::streaming::Client::Client ( const std::string &  fallback_address)
inlineexplicit

Definition at line 29 of file streaming/Client.h.

◆ ~Client()

carla::streaming::Client::~Client ( )
inline

Definition at line 32 of file streaming/Client.h.

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

+ Here is the call graph for this function:

Member Function Documentation

◆ AsyncRun()

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

Definition at line 51 of file streaming/Client.h.

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

Referenced by carla::client::detail::Client::Pimpl::Pimpl(), and TEST().

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

◆ Run()

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

Definition at line 47 of file streaming/Client.h.

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

+ Here is the call graph for this function:

◆ Subscribe()

template<typename Functor >
void carla::streaming::Client::Subscribe ( const Token token,
Functor &&  callback 
)
inline
Warning
cannot subscribe twice to the same stream (even if it's a MultiStream).

Definition at line 39 of file streaming/Client.h.

References _client, _service, carla::ThreadPool::io_context(), and carla::streaming::low_level::Client< T >::Subscribe().

Referenced by TEST().

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

◆ UnSubscribe()

void carla::streaming::Client::UnSubscribe ( const Token token)
inline

Definition at line 43 of file streaming/Client.h.

References _client, and carla::streaming::low_level::Client< T >::UnSubscribe().

+ Here is the call graph for this function:

Member Data Documentation

◆ _client

underlying_client carla::streaming::Client::_client
private

Definition at line 61 of file streaming/Client.h.

Referenced by Subscribe(), and UnSubscribe().

◆ _service

ThreadPool carla::streaming::Client::_service
private

Definition at line 59 of file streaming/Client.h.

Referenced by AsyncRun(), Run(), Subscribe(), and ~Client().


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