54 return Stream.MakeBuffer();
58 template <
typename SensorT,
typename... ArgsT>
59 void Send(SensorT &Sensor, ArgsT &&... Args);
61 template <
typename SensorT,
typename... ArgsT>
71 if (HeaderStr->
frame != FrameNumber)
74 HeaderStr->
frame = FrameNumber;
120 template <
typename SensorT>
122 const SensorT &InSensor,
144template <
typename SensorT,
typename... ArgsT>
155 Stream.Write(ViewHeader, ViewData);
159template <
typename SensorT,
typename... ArgsT>
166 Stream.Write(ViewHeader, std::forward<ArgsT>(Args)...);
A streaming channel for sending sensor data to clients, supports sending data asynchronously.
FAsyncDataStreamTmpl(FAsyncDataStreamTmpl &&)=default
FTransform GetSensorTransform()
return the transform of the sensor
void SetFrameNumber(uint64_t FrameNumber)
allow to change the frame number of the header
void SerializeAndSend(SensorT &Sensor, ArgsT &&... Args)
carla::Buffer PopBufferFromPool()
Pop a Buffer from the pool.
uint64_t GetSensorType()
return the type of sensor of this stream
double GetSensorTimestamp()
return the timestamp of the sensor
auto GetToken() const
Return the token that allows subscribing to this stream.
void Send(SensorT &Sensor, ArgsT &&... Args)
Send some data down the stream.
A streaming channel for sending sensor data to clients.
boost::optional< StreamType > Stream
static std::shared_ptr< BufferView > CreateFrom(Buffer &&buffer)
const value_type * data() const noexcept
Direct access to the allocated memory or nullptr if no memory is allocated.
static Buffer Serialize(Sensor &sensor, Args &&... args)
Serialize the arguments provided into a Buffer by calling to the serializer registered for the given ...
static void log_info(Args &&... args)