Class WriterHistory

Inheritance Relationships

Base Type

Derived Type

Class Documentation

class WriterHistory : public eprosima::fastrtps::rtps::History

Class WriterHistory, container of the different CacheChanges of a writer

Subclassed by eprosima::fastrtps::PublisherHistory

Public Functions

RTPS_DllAPI WriterHistory(const HistoryAttributes &att)

Constructor of the WriterHistory.

virtual RTPS_DllAPI ~WriterHistory() override
RTPS_DllAPI bool add_change (CacheChange_t *a_change)

Add a CacheChange_t to the WriterHistory.

Parameters:

a_change – Pointer to the CacheChange_t to be added.

Returns:

True if added.

RTPS_DllAPI bool add_change (CacheChange_t *a_change, WriteParams &wparams)

Add a CacheChange_t to the WriterHistory.

Parameters:
  • a_change – Pointer to the CacheChange_t to be added.

  • wparams – Extra write parameters.

Returns:

True if added.

virtual RTPS_DllAPI iterator remove_change_nts (const_iterator removal, bool release=true) override

Remove a specific change from the history. No Thread Safe

Parameters:
  • removal – iterator to the change for removal

  • release – specifies if the change should be return to the pool

Returns:

iterator to the next change if any

virtual RTPS_DllAPI iterator remove_change_nts (const_iterator removal, const std::chrono::time_point< std::chrono::steady_clock > &max_blocking_time, bool release=true) override

Remove a specific change from the history. No Thread Safe

Parameters:
  • removal – iterator to the change for removal

  • release – specifies if the change should be return to the pool

  • max_blocking_time[in] Maximum time this method has to complete the task.

Returns:

iterator to the next change if any

virtual RTPS_DllAPI bool matches_change (const CacheChange_t *inner, CacheChange_t *outer) override

Criteria to search a specific CacheChange_t on history

Parameters:
  • inner – change to compare

  • outer – change for comparison

Returns:

true if inner matches outer criteria

virtual RTPS_DllAPI bool remove_change_g (CacheChange_t *a_change)
virtual RTPS_DllAPI bool remove_change_g (CacheChange_t *a_change, const std::chrono::time_point< std::chrono::steady_clock > &max_blocking_time)
RTPS_DllAPI bool remove_change (const SequenceNumber_t &sequence_number)
RTPS_DllAPI CacheChange_t * remove_change_and_reuse (const SequenceNumber_t &sequence_number)
RTPS_DllAPI bool remove_min_change ()

Remove the CacheChange_t with the minimum sequenceNumber.

Returns:

True if correctly removed.

RTPS_DllAPI bool remove_min_change (const std::chrono::time_point< std::chrono::steady_clock > &max_blocking_time)

Remove the CacheChange_t with the minimum sequenceNumber.

Parameters:

max_blocking_time[in] Maximum time this method has to complete the task.

Returns:

True if correctly removed.

inline RTPS_DllAPI SequenceNumber_t next_sequence_number () const
RTPS_DllAPI bool remove_change (CacheChange_t *ch)

Introduce base class method into scope.

RTPS_DllAPI bool remove_change (CacheChange_t *ch, const std::chrono::time_point< std::chrono::steady_clock > &max_blocking_time)

Introduce base class method into scope.

inline RTPS_DllAPI iterator remove_change (const_iterator removal, bool release=true)

Introduce base class method into scope.

Protected Functions

virtual RTPS_DllAPI bool do_reserve_cache (CacheChange_t **change, uint32_t size) override
virtual RTPS_DllAPI void do_release_cache (CacheChange_t *ch) override
bool add_change_(CacheChange_t *a_change, WriteParams &wparams, std::chrono::time_point<std::chrono::steady_clock> max_blocking_time = std::chrono::steady_clock::now() + std::chrono::hours(24))

Introduce a change into the history, and let the associated writer send it.

Parameters:
  • a_change[inout] The change to be added. Its sequenceNumber and sourceTimestamp will be filled by this method. Its wparams will be filled from parameter wparams.

  • wparams[inout] On input, it holds the WriteParams to be copied into a_change. On output, will be filled with the sample identity assigned to a_change.

  • max_blocking_time[in] Maximum time point the writer is allowed to be blocked till the change is put into the wire or the sending queue.

Returns:

whether a_change could be added to the history.

template<typename PreCommitHook>
inline bool add_change_with_commit_hook(CacheChange_t *a_change, WriteParams &wparams, PreCommitHook pre_commit, std::chrono::time_point<std::chrono::steady_clock> max_blocking_time)

Introduce a change into the history, and let the associated writer send it.

Parameters:
  • a_change[inout] The change to be added. Its sequenceNumber and sourceTimestamp will be filled by this method. Its wparams will be filled from parameter wparams.

  • wparams[inout] On input, it holds the WriteParams to be copied into a_change. On output, will be filled with the sample identity assigned to a_change.

  • pre_commit[in] Functor called after a_change has been added to the history, and its information has been filled, but before the writer is notified of the insertion.

  • max_blocking_time[in] Maximum time point the writer is allowed to be blocked till the change is put into the wire or the sending queue.

Returns:

whether a_change could be added to the history.

Protected Attributes

SequenceNumber_t m_lastCacheChangeSeqNum

Last CacheChange Sequence Number added to the History.

RTPSWriter *mp_writer

Pointer to the associated RTPSWriter;.

uint32_t high_mark_for_frag_ = 0