54 bool sample_loss_pending =
false;
55 bool over_range_pending =
false;
56 RealType last_context_time = -1.0e300;
61 std::uint32_t stream_id = 0;
63 bool stream_open =
false;
64 bool stream_close =
false;
67 [[
nodiscard]] StreamState& stateFor(std::uint32_t stream_id);
68 [[
nodiscard]]
const StreamState& stateFor(std::uint32_t stream_id)
const;
70 void ensurePacketizer();
72 void appendPendingContexts(std::vector<SerializedPacket>& packets,
75 [[
nodiscard]]
bool enqueuePackets(std::vector<SerializedPacket> packets);
76 void emitTelemetry(std::vector<core::ReceiverOutputPacketTrace> packets = {},
bool force_stats =
false);
77 [[
nodiscard]] std::vector<core::ReceiverOutputPacketTrace> consumeSenderDropsLocked();
79 std::string event)
const;
81 [[
nodiscard]] SerializedPacket buildContextPacket(std::uint32_t stream_id,
RealType simulation_time,
82 bool stream_open,
bool stream_close);
83 void emitContext(std::uint32_t stream_id,
RealType simulation_time,
bool stream_open,
bool stream_close);
84 void applyDropped(
const DroppedDatagram& dropped);
87 std::string _simulation_name;
89 std::unique_ptr<DatagramSender> _provided_sender;
90 StreamRegistry _registry;
91 std::unique_ptr<Vita49Packetizer> _packetizer;
92 std::unique_ptr<PacedSender> _sender;
93 std::unordered_map<std::uint32_t, StreamState> _streams;
94 std::vector<PendingContext> _pending_contexts;
95 mutable std::recursive_mutex _mutex;
96 std::chrono::steady_clock::time_point _last_stats_emit = std::chrono::steady_clock::time_point::min();
97 std::chrono::steady_clock::time_point _last_packet_trace_emit = std::chrono::steady_clock::time_point::min();
98 std::vector<core::ReceiverOutputPacketTrace> _pending_packet_traces;
99 std::uint64_t _trace_sequence = 0;
100 bool _initialized =
false;
101 bool _finalized =
false;
102 bool _pacing_started =
false;