Class RTPSMessageGroup

Nested Relationships

Nested Types

Class Documentation

class RTPSMessageGroup

RTPSMessageGroup Class used to construct a RTPS message.

Public Functions

RTPSMessageGroup(RTPSParticipantImpl *participant, bool internal_buffer = false)

Basic constructor. Constructs a RTPSMessageGroup allowing to allocate its own buffer.

Parameters
  • participant – Pointer to the participant sending data.

  • internal_buffer – true indicates this object to allocate its own buffer. false indicates to get a buffer from the participant.

RTPSMessageGroup(RTPSParticipantImpl *participant, Endpoint *endpoint, RTPSMessageSenderInterface *msg_sender, std::chrono::steady_clock::time_point max_blocking_time_point = std::chrono::steady_clock::now() + std::chrono::hours(24))

Basic constructor. Constructs a RTPSMessageGroup allowing the destination endpoints to change.

Parameters
  • participant – Pointer to the participant sending data.

  • endpoint – Pointer to the endpoint sending data.

  • msg_sender – Pointer to message sender interface.

  • max_blocking_time_point – Future time point where blocking send should end.

~RTPSMessageGroup() noexcept(false)
bool add_data(const CacheChange_t &change, bool expects_inline_qos)

Adds a DATA message to the group.

Parameters
  • change – Reference to the cache change to send.

  • expects_inline_qos – True when one destination is expecting inline QOS.

Returns

True when message was added to the group.

bool add_data_frag(const CacheChange_t &change, const uint32_t fragment_number, bool expects_inline_qos)

Adds a DATA_FRAG message to the group.

Parameters
  • change – Reference to the cache change to send.

  • fragment_number – Index (1 based) of the fragment to send.

  • expects_inline_qos – True when one destination is expecting inline QOS.

Returns

True when message was added to the group.

bool add_heartbeat(const SequenceNumber_t &first_seq, const SequenceNumber_t &last_seq, Count_t count, bool is_final, bool liveliness_flag)

Adds a HEARTBEAT message to the group.

Parameters
  • first_seq – First available sequence number.

  • last_seq – Last available sequence number.

  • count – Counting identifier.

  • is_final – Should final flag be set?

  • liveliness_flag – Should liveliness flag be set?

Returns

True when message was added to the group.

bool add_gap(std::set<SequenceNumber_t> &changes_seq_numbers)

Adds one or more GAP messages to the group.

Parameters

changes_seq_numbers – Set of missed sequence numbers.

Returns

True when messages were added to the group.

bool add_gap(const SequenceNumber_t &gap_initial_sequence, const SequenceNumberSet_t &gap_bitmap)

Adds one GAP message to the group.

Parameters
  • gap_initial_sequence – Start of consecutive sequence numbers.

  • gap_bitmap – Bitmap of non-consecutive sequence numbers.

Returns

True when message was added to the group.

bool add_gap(const SequenceNumber_t &gap_initial_sequence, const SequenceNumberSet_t &gap_bitmap, const GUID_t &reader_guid)

Adds one GAP message to the group.

Parameters
  • gap_initial_sequence – Start of consecutive sequence numbers.

  • gap_bitmap – Bitmap of non-consecutive sequence numbers.

  • reader_guid – GUID of the destination reader.

Returns

True when message was added to the group.

bool add_acknack(const SequenceNumberSet_t &seq_num_set, int32_t count, bool final_flag)

Adds a ACKNACK message to the group.

Parameters
  • seq_num_set – Set of missing sequence numbers.

  • count – Counting identifier.

  • final_flag – Should final flag be set?

Returns

True when message was added to the group.

bool add_nackfrag(const SequenceNumber_t &seq_number, FragmentNumberSet_t fn_state, int32_t count)

Adds a NACKFRAG message to the group.

Parameters
  • seq_number – Sequence number being nack’ed.

  • fn_state – Set of missing fragment numbers.

  • count – Counting identifier.

Returns

True when message was added to the group.

void flush_and_reset()

To be used whenever destination locators/guids change between two add_xxx calls. Automatically called inside add_xxx calls if destinations_have_changed() method of RTPSMessageSenderInterface returns true. May become private again with a refactor of RTPSMessageSenderInterface, adding a group_has_been_flushed() method.

inline void sender(Endpoint *endpoint, RTPSMessageSenderInterface *msg_sender)

Change dynamically the sender of next RTPS submessages.

Parameters
  • endpoint – Pointer to next Endpoint sender. nullptr resets object to initial state.

  • msg_sender – Pointer to the RTPSMessageSenderInterface will be used to send next RTPS messages.. nullptr resets object to initial state.

Pre

(endpoint != nullptr && msg_sender != nullptr) || (endpoint == nullptr && msg_sender == nullptr)

inline void set_sent_bytes_limitation(uint32_t limit)
inline void reset_current_bytes_processed()
inline uint32_t get_current_bytes_processed() const

Public Static Functions

static inline constexpr uint32_t get_max_fragment_payload_size()

Maximum fragment size minus the headers.

class limit_exceeded : public std::runtime_error

Exception thrown when a operation exceeds the maximum bytes this object can process in the current period of time.

Public Functions

inline limit_exceeded()
virtual ~limit_exceeded() = default
class timeout : public std::runtime_error

Exception thrown when a operation exceeds the maximum blocking time.

Public Functions

inline timeout()
virtual ~timeout() = default