19.2.6.5. WriterHistory

class WriterHistory : public eprosima::fastdds::rtps::History

Class WriterHistory, container of the different CacheChanges of a writer

Public Functions

WriterHistory(const HistoryAttributes &att)

Construct a WriterHistory.

Parameters:

att – Attributes configuring the WriterHistory.

WriterHistory(const HistoryAttributes &att, const std::shared_ptr<IPayloadPool> &payload_pool)

Construct a WriterHistory with a custom payload pool.

Parameters:
WriterHistory(const HistoryAttributes &att, const std::shared_ptr<IPayloadPool> &payload_pool, const std::shared_ptr<IChangePool> &change_pool)

Construct a WriterHistory with custom payload and change pools.

Parameters:
const std::shared_ptr<IPayloadPool> &get_payload_pool() const

Get the payload pool used by this history.

Returns:

Reference to the payload pool used by this history.

const std::shared_ptr<IChangePool> &get_change_pool() const

Get the change pool used by this history.

Returns:

Reference to the change pool used by this history.

CacheChange_t *create_change(ChangeKind_t change_kind, InstanceHandle_t handle = c_InstanceHandle_Unknown)

Create a new CacheChange_t object.

Parameters:
  • change_kind – Kind of the change.

  • handleInstanceHandle_t of the change.

Returns:

Pointer to the new CacheChange_t object.

Pre:

A writer has been associated with this history

CacheChange_t *create_change(uint32_t payload_size, ChangeKind_t change_kind, InstanceHandle_t handle = c_InstanceHandle_Unknown)

Create a new CacheChange_t object with a specific payload size.

Parameters:
  • payload_size – Size of the payload.

  • change_kind – Kind of the change.

  • handleInstanceHandle_t of the change.

Returns:

Pointer to the new CacheChange_t object.

Pre:

A writer has been associated with this history

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.

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 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 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 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

bool remove_min_change()

Remove the CacheChange_t with the minimum sequenceNumber.

Returns:

True if correctly removed.

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.

bool release_change(CacheChange_t *ch)

Release a change when it is not being used anymore.

Parameters:

ch – Pointer to the cache change to be released.

Returns:

whether the operation succeeded or not

Pre:

  • A writer has been associated with this history

  • ch is not nullptr

  • ch points to a cache change obtained from a call to this->create_change

Post:

memory pointed to by ch is not accessed

bool remove_change(CacheChange_t *ch)

Introduce base class method into scope.

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 iterator remove_change(const_iterator removal, bool release = true)

Introduce base class method into scope.