Class StatelessWriter

Inheritance Relationships

Base Type

Derived Type

Class Documentation

class StatelessWriter : public eprosima::fastrtps::rtps::RTPSWriter

Class StatelessWriter, specialization of RTPSWriter that manages writers that don’t keep state of the matched readers.

Subclassed by eprosima::fastrtps::rtps::StatelessPersistentWriter

Public Functions

virtual ~StatelessWriter()
virtual void unsent_change_added_to_history(CacheChange_t *change, const std::chrono::time_point<std::chrono::steady_clock> &max_blocking_time) override

Add a specific change to all ReaderLocators.

Parameters
  • change – Pointer to the change.

  • max_blocking_time

virtual bool change_removed_by_history(CacheChange_t *change) override

Indicate the writer that a change has been removed by the history due to some HistoryQos requirement.

Parameters

change – Pointer to the change that is going to be removed.

Returns

True if removed correctly.

virtual bool matched_reader_add(const ReaderProxyData &data) override

Add a matched reader.

Parameters

data – Pointer to the ReaderProxyData object added.

Returns

True if added.

virtual bool matched_reader_remove(const GUID_t &reader_guid) override

Remove a matched reader.

Parameters

reader_guid – GUID of the reader to remove.

Returns

True if removed.

virtual bool matched_reader_is_matched(const GUID_t &reader_guid) override

Tells us if a specific Reader is matched against this writer

Parameters

reader_guid – GUID of the reader to check.

Returns

True if it was matched.

inline virtual void reader_data_filter(fastdds::rtps::IReaderDataFilter *filter) final

Set a content filter to perform content filtering on this writer.

This method sets a content filter that will be used to check whether a cache change is relevant for a reader or not.

Parameters

filter – The content filter to use on this writer. May be nullptr to remove the content filter (i.e. treat all samples as relevant).

inline virtual const fastdds::rtps::IReaderDataFilter *reader_data_filter() const final

Get the content filter used to perform content filtering on this writer.

Returns

The content filter used on this writer.

inline virtual void updateAttributes(const WriterAttributes &att) override

Update the Attributes of the Writer.

Parameters

att – New attributes

bool set_fixed_locators(const LocatorList_t &locator_list)
void unsent_changes_reset()

Reset the unsent changes.

virtual bool is_acked_by_all(const CacheChange_t *change) const override

Check if a specific change has been acknowledged by all Readers. Is only useful in reliable Writer. In BE Writers returns false when pending to be sent.

Returns

True if acknowledged by all.

virtual bool try_remove_change(const std::chrono::steady_clock::time_point&, std::unique_lock<RecursiveTimedMutex>&) override

Tries to remove a change waiting a maximum of the provided microseconds.

Parameters
  • max_blocking_time_point – Maximum time to wait for.

  • lock – Lock of the Change list.

Returns

at least one change has been removed

virtual bool wait_for_acknowledgement(const SequenceNumber_t &seq, const std::chrono::steady_clock::time_point &max_blocking_time_point, std::unique_lock<RecursiveTimedMutex> &lock) override

Waits till a change has been acknowledged.

Parameters
  • seq – Sequence number to wait for acknowledgement.

  • max_blocking_time_point – Maximum time to wait for.

  • lock – Lock of the Change list.

Returns

true when change was acknowledged, false when timeout is reached.

virtual bool send_nts(CDRMessage_t *message, const LocatorSelectorSender &locator_selector, std::chrono::steady_clock::time_point &max_blocking_time_point) const override

Send a message through this interface.

Parameters
  • message – Pointer to the buffer with the message already serialized.

  • locator_selectorRTPSMessageSenderInterface reference uses for selecting locators. The reference has to be a member of this RTPSWriter object.

  • max_blocking_time_point – Future timepoint where blocking send should end.

inline size_t getMatchedReadersSize() const

Get the number of matched readers

Returns

Number of the matched readers

virtual DeliveryRetCode deliver_sample_nts(CacheChange_t *cache_change, RTPSMessageGroup &group, LocatorSelectorSender &locator_selector, const std::chrono::time_point<std::chrono::steady_clock> &max_blocking_time) override

Tells writer the sample can be sent to the network. This function should be used by a fastdds::rtps::FlowController.

Note

Must be non-thread safe.

Parameters
  • cache_change – Pointer to the CacheChange_t that represents the sample which can be sent.

  • groupRTPSMessageGroup reference uses for generating the RTPS message.

  • locator_selectorRTPSMessageSenderInterface reference uses for selecting locators. The reference has to be a member of this RTPSWriter object.

  • max_blocking_time – Future timepoint where blocking send should end.

Returns

Return code.

inline virtual LocatorSelectorSender &get_general_locator_selector() override
inline virtual LocatorSelectorSender &get_async_locator_selector() override

Protected Functions

StatelessWriter(RTPSParticipantImpl *participant, const GUID_t &guid, const WriterAttributes &attributes, fastdds::rtps::FlowController *flow_controller, WriterHistory *history, WriterListener *listener = nullptr)
StatelessWriter(RTPSParticipantImpl *impl, const GUID_t &guid, const WriterAttributes &att, const std::shared_ptr<IPayloadPool> &payload_pool, fastdds::rtps::FlowController *flow_controller, WriterHistory *hist, WriterListener *listen = nullptr)
StatelessWriter(RTPSParticipantImpl *impl, const GUID_t &guid, const WriterAttributes &att, const std::shared_ptr<IPayloadPool> &payload_pool, const std::shared_ptr<IChangePool> &change_pool, fastdds::rtps::FlowController *flow_controller, WriterHistory *hist, WriterListener *listen = nullptr)