Keeps the mapping between streams and sessions. More...
#include <Dispatcher.h>
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 |
Keeps the mapping between streams and sessions.
Definition at line 27 of file Dispatcher.h.
|
inlineexplicit |
Definition at line 31 of file Dispatcher.h.
References CloseStream(), DeregisterSession(), GetToken(), MakeStream(), RegisterSession(), and ~Dispatcher().
carla::streaming::detail::Dispatcher::~Dispatcher | ( | ) |
Definition at line 19 of file Dispatcher.cpp.
References _stream_map, and carla::log_error().
Referenced by Dispatcher().
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().
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().
|
inline |
Definition at line 53 of file Dispatcher.h.
References _stream_map.
Referenced by carla::streaming::low_level::Server< detail::tcp::Server >::DisableForROS().
|
inline |
Definition at line 46 of file Dispatcher.h.
References _stream_map.
Referenced by carla::streaming::low_level::Server< detail::tcp::Server >::EnableForROS().
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().
|
inline |
Definition at line 60 of file Dispatcher.h.
References _stream_map.
Referenced by carla::streaming::low_level::Server< detail::tcp::Server >::IsEnabledForROS().
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().
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().
|
private |
Definition at line 74 of file Dispatcher.h.
Referenced by GetToken(), and MakeStream().
|
private |
Definition at line 72 of file Dispatcher.h.
Referenced by CloseStream(), DeregisterSession(), GetToken(), MakeStream(), and RegisterSession().
|
private |
Definition at line 76 of file Dispatcher.h.
Referenced by CloseStream(), DeregisterSession(), DisableForROS(), EnableForROS(), GetToken(), IsEnabledForROS(), MakeStream(), RegisterSession(), and ~Dispatcher().