15#include <unordered_map>
34 std::optional<token_type>
Resolve(
43 std::optional<carla::streaming::Stream>
Bind(
70 std::optional<carla::streaming::Stream>
reserved;
79 std::unordered_map<actor_id_type, Entry>
_entries;
Secondary-side map from a primary sensor actor to its local stream, exposed to clients only through a...
carla::streaming::detail::stream_id_type stream_id_type
static void Forget(carla::streaming::Server &server, const Entry &entry)
std::optional< token_type > Resolve(carla::streaming::Server &server, actor_id_type actor_id, stream_id_type primary_stream_id)
Token that serves primary actor actor_id under primary_stream_id, reserving a local stream if the sen...
epoch_type BeginEpisodeChange(carla::streaming::Server &server)
The primary switched episode: forgets every actor and returns the epoch the secondary must pass to Op...
bool IsEpisodeOpen()
Whether Bind()/Unbind() are accepted, i.e.
void OpenEpisode(epoch_type epoch)
Accepts binding if epoch is the latest one BeginEpisodeChange() issued.
std::optional< carla::streaming::Stream > Bind(carla::streaming::Server &server, actor_id_type actor_id, stream_id_type sensor_stream_id, bool can_adopt)
Returns the stream reserved for actor_id if can_adopt (the sensor has never ticked) and the sensor mu...
std::unordered_map< actor_id_type, Entry > _entries
void Unbind(carla::streaming::Server &server, actor_id_type actor_id)
Forgets actor_id, closing its reserved stream if no sensor adopted it.
Serializes a stream endpoint.
This file contains definitions of common data structures used in traffic manager.
std::optional< carla::streaming::Stream > reserved
std::optional< stream_id_type > primary_stream_id