Class ReaderHistory, container of the different CacheChanges of a reader. More...
#include <ReaderHistory.hpp>
Public Member Functions | |
FASTDDS_EXPORTED_API | ReaderHistory (const HistoryAttributes &att) |
Constructor of the ReaderHistory. | |
FASTDDS_EXPORTED_API | ~ReaderHistory () override |
virtual FASTDDS_EXPORTED_API bool | can_change_be_added_nts (const GUID_t &writer_guid, uint32_t total_payload_size, size_t unknown_missing_changes_up_to, bool &will_never_be_accepted) const |
Check if a new change can be added to this history. | |
virtual FASTDDS_EXPORTED_API bool | received_change (CacheChange_t *change, size_t unknown_missing_changes_up_to) |
Virtual method that is called when a new change is received. | |
virtual FASTDDS_EXPORTED_API bool | received_change (CacheChange_t *change, size_t unknown_missing_changes_up_to, fastdds::dds::SampleRejectedStatusKind &rejection_reason) |
Virtual method that is called when a new change is received. | |
FASTDDS_EXPORTED_API virtual bool | completed_change (rtps::CacheChange_t *change) |
Called when a fragmented change is received completely by the Subscriber. | |
virtual FASTDDS_EXPORTED_API bool | completed_change (CacheChange_t *change, size_t unknown_missing_changes_up_to, fastdds::dds::SampleRejectedStatusKind &rejection_reason) |
Called when a fragmented change is received completely by the Subscriber. | |
FASTDDS_EXPORTED_API bool | add_change (CacheChange_t *a_change) |
Add a CacheChange_t to the ReaderHistory. | |
FASTDDS_EXPORTED_API iterator | remove_change_nts (const_iterator removal, bool release=true) override |
Remove a specific change from the history. | |
FASTDDS_EXPORTED_API 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. | |
FASTDDS_EXPORTED_API bool | matches_change (const CacheChange_t *inner, CacheChange_t *outer) override |
Criteria to search a specific CacheChange_t on history. | |
FASTDDS_EXPORTED_API bool | remove_changes_with_guid (const GUID_t &a_guid) |
Remove all changes from the History that have a certain guid. | |
bool | remove_fragmented_changes_until (const SequenceNumber_t &seq_num, const GUID_t &writer_guid) |
Remove all fragmented changes from certain writer up to certain sequence number. | |
FASTDDS_EXPORTED_API bool | get_min_change_from (CacheChange_t **min_change, const GUID_t &writerGuid) |
virtual FASTDDS_EXPORTED_API void | writer_unmatched (const GUID_t &writer_guid, const SequenceNumber_t &last_notified_seq) |
Called when a writer is unmatched from the reader holding this history. | |
virtual FASTDDS_EXPORTED_API void | writer_update_its_ownership_strength_nts (const GUID_t &writer_guid, const uint32_t ownership_strength) |
This function should be called by reader if a writer updates its ownership strength. | |
FASTDDS_EXPORTED_API bool | remove_change (CacheChange_t *ch) |
Introduce base class method into scope. | |
FASTDDS_EXPORTED_API bool | remove_change (CacheChange_t *ch, const std::chrono::time_point< std::chrono::steady_clock > &max_blocking_time) |
Introduce base class method into scope. | |
FASTDDS_EXPORTED_API iterator | remove_change (const_iterator removal, bool release=true) |
Introduce base class method into scope. | |
![]() | |
FASTDDS_EXPORTED_API bool | isFull () |
Check if the history is full. | |
FASTDDS_EXPORTED_API size_t | getHistorySize () |
Get the History size. | |
FASTDDS_EXPORTED_API const_iterator | find_change_nts (CacheChange_t *ch) |
Find a specific change in the history using the matches_change method criteria. | |
FASTDDS_EXPORTED_API bool | remove_all_changes () |
Remove all changes from the History. | |
FASTDDS_EXPORTED_API bool | remove_change (CacheChange_t *ch) |
Remove a specific change from the history. | |
FASTDDS_EXPORTED_API bool | remove_change (CacheChange_t *ch, const std::chrono::time_point< std::chrono::steady_clock > &max_blocking_time) |
Remove a specific change from the history. | |
FASTDDS_EXPORTED_API const_iterator | find_change (CacheChange_t *ch) |
Find a specific change in the history using the matches_change method criteria. | |
FASTDDS_EXPORTED_API iterator | remove_change (const_iterator removal, bool release=true) |
Remove a specific change from the history. | |
FASTDDS_EXPORTED_API iterator | changesBegin () |
Get the beginning of the changes history iterator. | |
FASTDDS_EXPORTED_API reverse_iterator | changesRbegin () |
FASTDDS_EXPORTED_API iterator | changesEnd () |
Get the end of the changes history iterator. | |
FASTDDS_EXPORTED_API reverse_iterator | changesRend () |
FASTDDS_EXPORTED_API bool | get_min_change (CacheChange_t **min_change) |
Get the minimum CacheChange_t. | |
FASTDDS_EXPORTED_API bool | get_max_change (CacheChange_t **max_change) |
Get the maximum CacheChange_t. | |
FASTDDS_EXPORTED_API uint32_t | getTypeMaxSerialized () |
Get the maximum serialized payload size. | |
FASTDDS_EXPORTED_API RecursiveTimedMutex * | getMutex () const |
Get the mutex. | |
FASTDDS_EXPORTED_API bool | get_change (const SequenceNumber_t &seq, const GUID_t &guid, CacheChange_t **change) const |
const_iterator | get_change_nts (const SequenceNumber_t &seq, const GUID_t &guid, CacheChange_t **change, const_iterator hint) const |
bool | get_earliest_change (CacheChange_t **change) |
A method to get the change with the earliest timestamp. | |
Protected Member Functions | |
FASTDDS_EXPORTED_API void | do_release_cache (CacheChange_t *ch) override |
template<typename Pred > | |
void | remove_changes_with_pred (Pred pred) |
![]() | |
History (const HistoryAttributes &att) | |
History (History &&)=delete | |
History & | operator= (History &&)=delete |
virtual | ~History () |
void | print_changes_seqNum2 () |
Print the seqNum of the changes in the History (for debuggisi, mng purposes). | |
History::iterator | remove_iterator_constness (const_iterator c_it) |
Removes the constness of a const_iterator to obtain a regular iterator. | |
Protected Attributes | |
RTPSReader * | mp_reader |
Pointer to the reader. | |
![]() | |
std::vector< CacheChange_t * > | m_changes |
Vector of pointers to the CacheChange_t. | |
bool | m_isHistoryFull = false |
Variable to know if the history is full without needing to block the History mutex. | |
RecursiveTimedMutex * | mp_mutex = nullptr |
Mutex for the History. | |
Friends | |
class | RTPSReader |
Additional Inherited Members | |
![]() | |
using | iterator = std::vector<CacheChange_t*>::iterator |
using | reverse_iterator = std::vector<CacheChange_t*>::reverse_iterator |
using | const_iterator = std::vector<CacheChange_t*>::const_iterator |
![]() | |
HistoryAttributes | m_att |
Attributes of the History. | |
Class ReaderHistory, container of the different CacheChanges of a reader.
FASTDDS_EXPORTED_API ReaderHistory | ( | const HistoryAttributes & | att | ) |
Constructor of the ReaderHistory.
It needs a HistoryAttributes.
|
override |
FASTDDS_EXPORTED_API bool add_change | ( | CacheChange_t * | a_change | ) |
Add a CacheChange_t to the ReaderHistory.
a_change | Pointer to the CacheChange to add. |
|
virtual |
Check if a new change can be added to this history.
[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. |
|
inlinevirtual |
Called when a fragmented change is received completely by the Subscriber.
Will find its instance and store it.
[in] | change | The received change |
[in] | unknown_missing_changes_up_to | Number of missing changes before this one |
[out] | rejection_reason | In case of been rejected the sample, it will contain the reason of the rejection. |
|
inlinevirtual |
Called when a fragmented change is received completely by the Subscriber.
Will find its instance and store it.
[in] | change | The received change |
|
overrideprotectedvirtual |
Implements History.
FASTDDS_EXPORTED_API bool get_min_change_from | ( | CacheChange_t ** | min_change, |
const GUID_t & | writerGuid ) |
|
overridevirtual |
Criteria to search a specific CacheChange_t on history.
inner | change to compare |
outer | change for comparison |
Reimplemented from History.
|
virtual |
Virtual method that is called when a new change is received.
In this implementation this method just calls add_change. The user can overload this method in case he needs to perform additional checks before adding the change.
change | Pointer to the change |
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. |
|
inlinevirtual |
Virtual method that is called when a new change is received.
In this implementation this method just calls add_change. The user can overload this method in case he needs to perform additional checks before adding the change.
[in] | change | Pointer to the 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] | rejection_reason | In case of been rejected the sample, it will contain the reason of the rejection. |
FASTDDS_EXPORTED_API bool remove_change | ( | CacheChange_t * | ch | ) |
Introduce base class method into scope.
FASTDDS_EXPORTED_API 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 |
Introduce base class method into scope.
|
overridevirtual |
Remove a specific change from the history.
No Thread Safe
removal | iterator to the change for removal |
release | specifies if the change must be returned to the pool |
Reimplemented from History.
|
overridevirtual |
Remove a specific change from the history.
No Thread Safe
removal | iterator to the change for removal | |
[in] | max_blocking_time | Maximum time this method has to complete the task. |
release | specifies if the change must be returned to the pool |
Reimplemented from History.
FASTDDS_EXPORTED_API bool remove_changes_with_guid | ( | const GUID_t & | a_guid | ) |
Remove all changes from the History that have a certain guid.
a_guid | Pointer to the target guid to search for. |
|
inlineprotected |
bool remove_fragmented_changes_until | ( | const SequenceNumber_t & | seq_num, |
const GUID_t & | writer_guid ) |
Remove all fragmented changes from certain writer up to certain sequence number.
seq_num | First SequenceNumber_t not to be removed. |
writer_guid | GUID of the writer for which changes should be looked for. |
|
virtual |
Called when a writer is unmatched from the reader holding this history.
This method will remove all the changes on the history that came from the writer being unmatched and which have not yet been notified to the user.
writer_guid | GUID of the writer being unmatched. |
last_notified_seq | Last sequence number from the specified writer that was notified to the user. |
|
inlinevirtual |
This function should be called by reader if a writer updates its ownership strength.
[in] | writer_guid | Guid of the writer which changes its ownership strength. |
[out] | ownership_strength | New value of the writer's Ownership strength. |
|
friend |
|
protected |
Pointer to the reader.