18#include <unordered_map>
24 class MultiStreamState;
25 using StreamMap = std::unordered_map<stream_id_type, std::shared_ptr<MultiStreamState>>;
31 template <
typename Protocol,
typename EndPo
intType>
66 std::scoped_lock<std::mutex> lock(
_mutex);
71 std::scoped_lock<std::mutex> lock(
_mutex);
74 search->second->EnableForROS();
79 std::scoped_lock<std::mutex> lock(
_mutex);
82 search->second->DisableForROS();
87 std::scoped_lock<std::mutex> lock(
_mutex);
90 return search->second->IsEnabledForROS();
Keeps the mapping between streams and sessions.
bool _topic_visibility_default_enabled
void SetSessionsUseStreamAliases(bool enabled)
When enabled, a session subscribes through an alias (see SetStreamAlias) and a stream id without an a...
void SetStreamAlias(stream_id_type alias, stream_id_type stream_id)
Routes sessions subscribing to alias to the local stream stream_id.
void DeregisterSession(std::shared_ptr< Session > session)
std::unordered_map< const Session *, std::weak_ptr< MultiStreamState > > _session_streams
std::optional< stream_id_type > ResolveSessionStreamId(stream_id_type session_stream_id) const
Stream a session subscribing to session_stream_id belongs to.
Dispatcher(const EndPoint< Protocol, EndPointType > &ep)
bool _sessions_use_stream_aliases
carla::streaming::Stream MakeStream()
std::optional< token_type > FindToken(stream_id_type stream_id)
Like GetToken(), but returns std::nullopt for an unknown stream_id instead of creating an empty strea...
bool RegisterSession(std::shared_ptr< Session > session)
void DisableForROS(stream_id_type sensor_id)
void SetROS2TopicVisibilityDefaultEnabled(bool enabled)
bool IsEnabledForROS(stream_id_type sensor_id)
std::optional< stream_id_type > FindStreamAlias(stream_id_type alias)
void CloseStream(carla::streaming::detail::stream_id_type id)
std::unordered_map< stream_id_type, stream_id_type > _stream_aliases
void RemoveStreamAlias(stream_id_type alias)
void EnableForROS(stream_id_type sensor_id)
token_type GetToken(stream_id_type sensor_id)
Serializes a stream endpoint.
std::unordered_map< stream_id_type, std::shared_ptr< MultiStreamState > > StreamMap
This file contains definitions of common data structures used in traffic manager.