Fast RTPS  Version 2.14.1
Fast RTPS
Loading...
Searching...
No Matches

Class PublisherHistory, implementing a WriterHistory with support for keyed topics and HistoryQOS. More...

#include <PublisherHistory.h>

Inheritance diagram for PublisherHistory:

Public Member Functions

 PublisherHistory (const TopicAttributes &topic_att, uint32_t payloadMax, rtps::MemoryManagementPolicy_t mempolicy)
 Constructor of the PublisherHistory.
 
virtual ~PublisherHistory ()
 
void rebuild_instances ()
 Rebuild instances loaded from DB.
 
bool register_instance (const rtps::InstanceHandle_t &instance_handle, std::unique_lock< RecursiveTimedMutex > &lock, const std::chrono::time_point< std::chrono::steady_clock > &max_blocking_time)
 Tries to reserve resources for the new instance.
 
bool add_pub_change (rtps::CacheChange_t *change, rtps::WriteParams &wparams, std::unique_lock< RecursiveTimedMutex > &lock, const std::chrono::time_point< std::chrono::steady_clock > &max_blocking_time)
 Add a change comming from the Publisher.
 
bool removeAllChange (size_t *removed)
 Remove all change from the associated history.
 
bool removeMinChange ()
 Remove the change with the minimum sequence Number.
 
bool remove_change_pub (rtps::CacheChange_t *change)
 Remove a change by the publisher History.
 
bool remove_change_g (rtps::CacheChange_t *a_change) override
 
bool remove_change_g (rtps::CacheChange_t *a_change, const std::chrono::time_point< std::chrono::steady_clock > &max_blocking_time) override
 
bool remove_instance_changes (const rtps::InstanceHandle_t &handle, const rtps::SequenceNumber_t &seq_up_to)
 
bool set_next_deadline (const rtps::InstanceHandle_t &handle, const std::chrono::steady_clock::time_point &next_deadline_us)
 Sets the next deadline for the given instance.
 
bool get_next_deadline (rtps::InstanceHandle_t &handle, std::chrono::steady_clock::time_point &next_deadline_us)
 Returns the deadline for the instance that is next going to 'expire'.
 
bool is_key_registered (const rtps::InstanceHandle_t &handle)
 Checks if the instance's key is registered.
 
bool wait_for_acknowledgement_last_change (const rtps::InstanceHandle_t &handle, std::unique_lock< RecursiveTimedMutex > &lock, const std::chrono::time_point< std::chrono::steady_clock > &max_blocking_time)
 Waits till the last change in the instance history has been acknowledged.
 

Detailed Description

Class PublisherHistory, implementing a WriterHistory with support for keyed topics and HistoryQOS.

This class is created by the PublisherImpl and should not be used by the user directly.

Constructor & Destructor Documentation

◆ PublisherHistory()

PublisherHistory ( const TopicAttributes topic_att,
uint32_t  payloadMax,
rtps::MemoryManagementPolicy_t  mempolicy 
)

Constructor of the PublisherHistory.

Parameters
topic_attTopicAttributed
payloadMaxMaximum payload size.
mempolicySet whether the payloads ccan dynamically resized or not.

◆ ~PublisherHistory()

virtual ~PublisherHistory ( )
virtual

Member Function Documentation

◆ add_pub_change()

bool add_pub_change ( rtps::CacheChange_t *  change,
rtps::WriteParams &  wparams,
std::unique_lock< RecursiveTimedMutex > &  lock,
const std::chrono::time_point< std::chrono::steady_clock > &  max_blocking_time 
)

Add a change comming from the Publisher.

Parameters
changePointer to the change
wparamsExtra write parameters.
lock
max_blocking_time
Returns
True if added.

◆ get_next_deadline()

bool get_next_deadline ( rtps::InstanceHandle_t &  handle,
std::chrono::steady_clock::time_point &  next_deadline_us 
)

Returns the deadline for the instance that is next going to 'expire'.

Parameters
handleThe handle for the instance that will next miss the deadline
next_deadline_usThe time point when the deadline will occur
Returns
True if deadline could be retrieved for the given instance

◆ is_key_registered()

bool is_key_registered ( const rtps::InstanceHandle_t &  handle)

Checks if the instance's key is registered.

Parameters
[in]handleInstance's key. return true if instance's key is registered in the history.

◆ rebuild_instances()

void rebuild_instances ( )

Rebuild instances loaded from DB.

Does nothing if the topic doesn't have key.

◆ register_instance()

bool register_instance ( const rtps::InstanceHandle_t &  instance_handle,
std::unique_lock< RecursiveTimedMutex > &  lock,
const std::chrono::time_point< std::chrono::steady_clock > &  max_blocking_time 
)

Tries to reserve resources for the new instance.

Parameters
instance_handleInstance's key.
lockLock which should be unlock in case the operation has to wait.
max_blocking_timeMaximum time the operation should be waiting.
Returns
True if resources was reserved successfully.

◆ remove_change_g() [1/2]

bool remove_change_g ( rtps::CacheChange_t *  a_change)
override

◆ remove_change_g() [2/2]

bool remove_change_g ( rtps::CacheChange_t *  a_change,
const std::chrono::time_point< std::chrono::steady_clock > &  max_blocking_time 
)
override

◆ remove_change_pub()

bool remove_change_pub ( rtps::CacheChange_t *  change)

Remove a change by the publisher History.

Parameters
changePointer to the CacheChange_t.
Returns
True if removed.

◆ remove_instance_changes()

bool remove_instance_changes ( const rtps::InstanceHandle_t &  handle,
const rtps::SequenceNumber_t &  seq_up_to 
)

◆ removeAllChange()

bool removeAllChange ( size_t *  removed)

Remove all change from the associated history.

Parameters
removedNumber of elements removed.
Returns
True if all elements were removed.

◆ removeMinChange()

bool removeMinChange ( )

Remove the change with the minimum sequence Number.

Returns
True if removed.

◆ set_next_deadline()

bool set_next_deadline ( const rtps::InstanceHandle_t &  handle,
const std::chrono::steady_clock::time_point &  next_deadline_us 
)

Sets the next deadline for the given instance.

Parameters
handleThe instance handle
next_deadline_usThe time point when the deadline will occur
Returns
True if deadline was set successfully

◆ wait_for_acknowledgement_last_change()

bool wait_for_acknowledgement_last_change ( const rtps::InstanceHandle_t &  handle,
std::unique_lock< RecursiveTimedMutex > &  lock,
const std::chrono::time_point< std::chrono::steady_clock > &  max_blocking_time 
)

Waits till the last change in the instance history has been acknowledged.

Parameters
handleInstance's handle.
lockLock which should be unlock in case the operation has to wait.
max_blocking_timeMaximum time the operation should be waiting.
Returns
true when the last change of the instance history is acknowleged, false when timeout is reached.

The documentation for this class was generated from the following file: