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

Keeps the mapping between streams and sessions. More...

#include <Dispatcher.h>

+ Collaboration diagram for carla::streaming::detail::Dispatcher:

Public Member Functions

void CloseStream (carla::streaming::detail::stream_id_type id)
 
void DeregisterSession (std::shared_ptr< Session > session)
 
void DisableForROS (stream_id_type sensor_id)
 
template<typename Protocol , typename EndPointType >
 Dispatcher (const EndPoint< Protocol, EndPointType > &ep)
 
void EnableForROS (stream_id_type sensor_id)
 
token_type GetToken (stream_id_type sensor_id)
 
bool IsEnabledForROS (stream_id_type sensor_id)
 
carla::streaming::Stream MakeStream ()
 
bool RegisterSession (std::shared_ptr< Session > session)
 
 ~Dispatcher ()
 

Private Attributes

token_type _cached_token
 
std::mutex _mutex
 
StreamMap _stream_map
 

Detailed Description

Keeps the mapping between streams and sessions.

Definition at line 27 of file Dispatcher.h.

Constructor & Destructor Documentation

◆ Dispatcher()

template<typename Protocol , typename EndPointType >
carla::streaming::detail::Dispatcher::Dispatcher ( const EndPoint< Protocol, EndPointType > &  ep)
inlineexplicit

Definition at line 31 of file Dispatcher.h.

References CloseStream(), DeregisterSession(), GetToken(), MakeStream(), RegisterSession(), and ~Dispatcher().

+ Here is the call graph for this function:

◆ ~Dispatcher()

carla::streaming::detail::Dispatcher::~Dispatcher ( )

Definition at line 19 of file Dispatcher.cpp.

References _stream_map, and carla::log_error().

Referenced by Dispatcher().

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

Member Function Documentation

◆ CloseStream()

void carla::streaming::detail::Dispatcher::CloseStream ( carla::streaming::detail::stream_id_type  id)

Definition at line 60 of file Dispatcher.cpp.

References _mutex, _stream_map, and carla::log_debug().

Referenced by carla::streaming::low_level::Server< detail::tcp::Server >::CloseStream(), and Dispatcher().

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

◆ DeregisterSession()

void carla::streaming::detail::Dispatcher::DeregisterSession ( std::shared_ptr< Session session)

Definition at line 91 of file Dispatcher.cpp.

References _mutex, _stream_map, DEBUG_ASSERT, and carla::log_debug().

Referenced by Dispatcher(), and carla::streaming::low_level::Server< detail::tcp::Server >::StartServer().

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

◆ DisableForROS()

void carla::streaming::detail::Dispatcher::DisableForROS ( stream_id_type  sensor_id)
inline

Definition at line 53 of file Dispatcher.h.

References _stream_map.

Referenced by carla::streaming::low_level::Server< detail::tcp::Server >::DisableForROS().

+ Here is the caller graph for this function:

◆ EnableForROS()

void carla::streaming::detail::Dispatcher::EnableForROS ( stream_id_type  sensor_id)
inline

Definition at line 46 of file Dispatcher.h.

References _stream_map.

Referenced by carla::streaming::low_level::Server< detail::tcp::Server >::EnableForROS().

+ Here is the caller graph for this function:

◆ GetToken()

token_type carla::streaming::detail::Dispatcher::GetToken ( stream_id_type  sensor_id)

Definition at line 106 of file Dispatcher.cpp.

References _cached_token, _mutex, _stream_map, carla::streaming::detail::token_type::get_port(), carla::streaming::detail::token_type::get_stream_id(), carla::log_debug(), and carla::streaming::detail::token_type::set_stream_id().

Referenced by Dispatcher(), and carla::streaming::low_level::Server< detail::tcp::Server >::GetToken().

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

◆ IsEnabledForROS()

bool carla::streaming::detail::Dispatcher::IsEnabledForROS ( stream_id_type  sensor_id)
inline

Definition at line 60 of file Dispatcher.h.

References _stream_map.

Referenced by carla::streaming::low_level::Server< detail::tcp::Server >::IsEnabledForROS().

+ Here is the caller graph for this function:

◆ MakeStream()

carla::streaming::Stream carla::streaming::detail::Dispatcher::MakeStream ( )

Definition at line 37 of file Dispatcher.cpp.

References _cached_token, _mutex, _stream_map, carla::streaming::detail::token_type::_token, carla::streaming::detail::token_type::get_stream_id(), carla::log_debug(), carla::streaming::detail::token_data::stream_id, and carla::throw_exception().

Referenced by Dispatcher(), carla::streaming::low_level::Server< detail::tcp::Server >::MakeStream(), and TEST().

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

◆ RegisterSession()

bool carla::streaming::detail::Dispatcher::RegisterSession ( std::shared_ptr< Session session)

Definition at line 74 of file Dispatcher.cpp.

References _mutex, _stream_map, DEBUG_ASSERT, carla::log_debug(), and carla::log_error().

Referenced by Dispatcher(), and carla::streaming::low_level::Server< detail::tcp::Server >::StartServer().

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

Member Data Documentation

◆ _cached_token

token_type carla::streaming::detail::Dispatcher::_cached_token
private

Definition at line 74 of file Dispatcher.h.

Referenced by GetToken(), and MakeStream().

◆ _mutex

std::mutex carla::streaming::detail::Dispatcher::_mutex
private

Definition at line 72 of file Dispatcher.h.

Referenced by CloseStream(), DeregisterSession(), GetToken(), MakeStream(), and RegisterSession().

◆ _stream_map

StreamMap carla::streaming::detail::Dispatcher::_stream_map
private

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