Class SubscriberHistory, container of the different CacheChanges of a subscriber.
More...
#include <SubscriberHistory.h>
|
| SubscriberHistory (const TopicAttributes &topic_att, fastdds::dds::TopicDataType *type, const fastrtps::ReaderQos &qos, uint32_t payloadMax, rtps::MemoryManagementPolicy_t mempolicy) |
| Constructor.
|
|
| ~SubscriberHistory () override |
|
iterator | remove_change_nts (const_iterator removal, bool release=true) override |
| Remove a specific change from the history.
|
|
bool | can_change_be_added_nts (const rtps::GUID_t &writer_guid, uint32_t total_payload_size, size_t unknown_missing_changes_up_to, bool &will_never_be_accepted) const override |
| Check if a new change can be added to this history.
|
|
bool | received_change (rtps::CacheChange_t *change, size_t unknown_missing_changes_up_to) override |
| Called when a change is received by the Subscriber.
|
|
bool | completed_change (rtps::CacheChange_t *change) override |
| Called when a fragmented change is received completely by the Subscriber.
|
|
bool | get_first_untaken_info (SampleInfo_t *info) |
| Returns information about the first untaken sample.
|
|
bool | remove_change_sub (rtps::CacheChange_t *change) |
| This method is called to remove a change from the SubscriberHistory.
|
|
bool | remove_change_sub (rtps::CacheChange_t *change, iterator &it) |
| This method is called to remove a change from the SubscriberHistory.
|
|
bool | set_next_deadline (const rtps::InstanceHandle_t &handle, const std::chrono::steady_clock::time_point &next_deadline_us) |
| A method to set the next deadline for the given instance.
|
|
bool | get_next_deadline (rtps::InstanceHandle_t &handle, std::chrono::steady_clock::time_point &next_deadline_us) |
| A method to get the next instance handle that will miss the deadline and the time when the deadline will occur.
|
|
|
Methods to read or take data from the History.
- Parameters
-
data | Pointer to the object where you want to read or take the information. |
info | Pointer to a SampleInfo_t object where you want |
max_blocking_time | Maximum time the function can be blocked. to store the information about the retrieved data |
|
bool | readNextData (void *data, SampleInfo_t *info, std::chrono::steady_clock::time_point &max_blocking_time) |
|
bool | takeNextData (void *data, SampleInfo_t *info, std::chrono::steady_clock::time_point &max_blocking_time) |
|
Class SubscriberHistory, container of the different CacheChanges of a subscriber.
◆ SubscriberHistory()
Constructor.
Requires information about the subscriber.
- Parameters
-
topic_att | TopicAttributes. |
type | TopicDataType. |
qos | ReaderQoS policy. |
payloadMax | Maximum payload size per change. |
mempolicy | Set whether the payloads ccan dynamically resized or not. |
◆ ~SubscriberHistory()
◆ can_change_be_added_nts()
bool can_change_be_added_nts |
( |
const rtps::GUID_t & |
writer_guid, |
|
|
uint32_t |
total_payload_size, |
|
|
size_t |
unknown_missing_changes_up_to, |
|
|
bool & |
will_never_be_accepted |
|
) |
| const |
|
override |
Check if a new change can be added to this history.
- Parameters
-
[in] | writer_guid | GUID of the writer where the change came from. |
[in] | total_payload_size | Total payload size of the incoming change. |
[in] | unknown_missing_changes_up_to | The number of changes from the same writer with a lower sequence number that could potentially be received in the future. |
[out] | will_never_be_accepted | When the method returns false , this parameter will inform whether the change could be accepted in the future or not. |
- Precondition
- change should not be present in the history
- Returns
- Whether a call to received_change will succeed when called with the same arguments.
◆ completed_change()
bool completed_change |
( |
rtps::CacheChange_t * |
change | ) |
|
|
override |
Called when a fragmented change is received completely by the Subscriber.
Will find its instance and store it.
- Precondition
- Change should be already present in the history.
- Parameters
-
[in] | change | The received change |
- Returns
◆ get_first_untaken_info()
Returns information about the first untaken sample.
- Parameters
-
[out] | info | Pointer to a SampleInfo_t structure to store first untaken sample information. |
- Returns
- true if sample info was returned. false if there is no sample to take.
◆ get_next_deadline()
bool get_next_deadline |
( |
rtps::InstanceHandle_t & |
handle, |
|
|
std::chrono::steady_clock::time_point & |
next_deadline_us |
|
) |
| |
A method to get the next instance handle that will miss the deadline and the time when the deadline will occur.
- Parameters
-
handle | The handle to the instance |
next_deadline_us | The time point when the instance will miss the deadline |
- Returns
- True if the deadline was retrieved successfully
◆ readNextData()
bool readNextData |
( |
void * |
data, |
|
|
SampleInfo_t * |
info, |
|
|
std::chrono::steady_clock::time_point & |
max_blocking_time |
|
) |
| |
◆ received_change()
bool received_change |
( |
rtps::CacheChange_t * |
change, |
|
|
size_t |
unknown_missing_changes_up_to |
|
) |
| |
|
override |
Called when a change is received by the Subscriber.
Will add the change to the history.
- Precondition
- Change should not be already present in the history.
- Parameters
-
[in] | change | The received change |
| unknown_missing_changes_up_to | Number of missing changes before this one |
- Returns
◆ remove_change_nts()
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 CacheChange_t to remove. |
release | defaults to true and hints if the CacheChange_t should return to the pool |
- Returns
- iterator to the next CacheChange_t or end iterator.
◆ remove_change_sub() [1/2]
bool remove_change_sub |
( |
rtps::CacheChange_t * |
change | ) |
|
This method is called to remove a change from the SubscriberHistory.
- Parameters
-
change | Pointer to the CacheChange_t. |
- Returns
- True if removed.
◆ remove_change_sub() [2/2]
bool remove_change_sub |
( |
rtps::CacheChange_t * |
change, |
|
|
iterator & |
it |
|
) |
| |
This method is called to remove a change from the SubscriberHistory.
- Parameters
-
[in] | change | Pointer to the CacheChange_t. |
[in,out] | it | Iterator pointing to change on input. Will point to next valid change on output. |
- 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 |
|
) |
| |
A method to set the next deadline for the given instance.
- Parameters
-
handle | The handle to the instance |
next_deadline_us | The time point when the deadline will occur |
- Returns
- True if the deadline was set correctly
◆ takeNextData()
bool takeNextData |
( |
void * |
data, |
|
|
SampleInfo_t * |
info, |
|
|
std::chrono::steady_clock::time_point & |
max_blocking_time |
|
) |
| |
The documentation for this class was generated from the following file: