Class MessageBufferStreamSink

Class Documentation

class MessageBufferStreamSink

A Boost IOStreams sink device designed to write bytes directly from a ROS message byte array (‘uint8[]’)

Public Types

typedef char char_type
typedef boost::iostreams::sink_tag category

Public Functions

explicit MessageBufferStreamSink(std::vector<unsigned char> &data)

Construct a stream sink from a data vector.

The input vector type is designed to work with ROS message fields of type ‘uint8[]’

Parameters:

data[in] A byte vector from a ROS message

MessageBufferStreamSink operator=(const MessageBufferStreamSink&) = delete

The stream sink is non-copyable.

std::streamsize write(const char_type *s, std::streamsize n)

Write n characters to the data vector.

This fulfills the Boost IOStreams sink concept.

Parameters:
  • s[in] The source location

  • n[in] The number of bytes to write to the stream

Returns:

The number of bytes written