20#ifndef FASTDDS_RTPS_HISTORY__HISTORY_HPP
21#define FASTDDS_RTPS_HISTORY__HISTORY_HPP
23#include <fastdds/fastdds_dll.hpp>
24#include <fastdds/rtps/history/IChangePool.hpp>
25#include <fastdds/rtps/history/IPayloadPool.hpp>
26#include <fastdds/rtps/common/SequenceNumber.hpp>
27#include <fastdds/rtps/common/Guid.hpp>
28#include <fastdds/rtps/attributes/HistoryAttributes.hpp>
29#include <fastdds/utils/TimedMutex.hpp>
58 using iterator = std::vector<CacheChange_t*>::iterator;
80 std::lock_guard<RecursiveTimedMutex> guard(*
mp_mutex);
102 bool release =
true);
114 const std::chrono::time_point<std::chrono::steady_clock>& max_blocking_time,
115 bool release =
true);
139 const std::chrono::time_point<std::chrono::steady_clock>& max_blocking_time);
149 std::lock_guard<RecursiveTimedMutex> guard(*
mp_mutex);
174 std::lock_guard<RecursiveTimedMutex> guard(*
mp_mutex);
Class HistoryAttributes, to specify the attributes of a WriterHistory or a ReaderHistory.
Definition HistoryAttributes.hpp:39
uint32_t payloadMaxSize
Maximum payload size of the history, default value 500.
Definition HistoryAttributes.hpp:46
Class History, container of the different CacheChanges and the methods to access them.
Definition History.hpp:45
virtual FASTDDS_EXPORTED_API bool matches_change(const CacheChange_t *ch_inner, CacheChange_t *ch_outer)
Verifies if an element of the changes collection matches a given change Derived classes have more inf...
std::vector< CacheChange_t * >::reverse_iterator reverse_iterator
Definition History.hpp:59
FASTDDS_EXPORTED_API bool get_min_change(CacheChange_t **min_change)
Get the minimum CacheChange_t.
History & operator=(History &&)=delete
std::vector< CacheChange_t * >::iterator iterator
Definition History.hpp:58
FASTDDS_EXPORTED_API size_t getHistorySize()
Get the History size.
Definition History.hpp:78
const_iterator get_change_nts(const SequenceNumber_t &seq, const GUID_t &guid, CacheChange_t **change, const_iterator hint) const
FASTDDS_EXPORTED_API const_iterator find_change(CacheChange_t *ch)
Find a specific change in the history using the matches_change method criteria.
Definition History.hpp:146
History(History &&)=delete
FASTDDS_EXPORTED_API reverse_iterator changesRbegin()
Definition History.hpp:187
FASTDDS_EXPORTED_API bool remove_change(CacheChange_t *ch)
Remove a specific change from the history.
virtual FASTDDS_EXPORTED_API void do_release_cache(CacheChange_t *ch)=0
bool get_earliest_change(CacheChange_t **change)
A method to get the change with the earliest timestamp.
virtual FASTDDS_EXPORTED_API iterator remove_change_nts(const_iterator removal, bool release=true)
Remove a specific change from the history.
void print_changes_seqNum2()
Print the seqNum of the changes in the History (for debuggisi, mng purposes).
FASTDDS_EXPORTED_API iterator remove_change(const_iterator removal, bool release=true)
Remove a specific change from the history.
Definition History.hpp:170
FASTDDS_EXPORTED_API bool get_change(const SequenceNumber_t &seq, const GUID_t &guid, CacheChange_t **change) const
std::vector< CacheChange_t * >::const_iterator const_iterator
Definition History.hpp:60
FASTDDS_EXPORTED_API iterator changesEnd()
Get the end of the changes history iterator.
Definition History.hpp:196
FASTDDS_EXPORTED_API const_iterator find_change_nts(CacheChange_t *ch)
Find a specific change in the history using the matches_change method criteria.
History::iterator remove_iterator_constness(const_iterator c_it)
Removes the constness of a const_iterator to obtain a regular iterator.
FASTDDS_EXPORTED_API uint32_t getTypeMaxSerialized()
Get the maximum serialized payload size.
Definition History.hpp:226
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 bool get_max_change(CacheChange_t **max_change)
Get the maximum CacheChange_t.
RecursiveTimedMutex * mp_mutex
Mutex for the History.
Definition History.hpp:269
HistoryAttributes m_att
Attributes of the History.
Definition History.hpp:63
History(const HistoryAttributes &att)
virtual 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)
Remove a specific change from the history.
FASTDDS_EXPORTED_API bool isFull()
Check if the history is full.
Definition History.hpp:69
FASTDDS_EXPORTED_API reverse_iterator changesRend()
Definition History.hpp:201
FASTDDS_EXPORTED_API iterator changesBegin()
Get the beginning of the changes history iterator.
Definition History.hpp:182
bool m_isHistoryFull
Variable to know if the history is full without needing to block the History mutex.
Definition History.hpp:266
FASTDDS_EXPORTED_API RecursiveTimedMutex * getMutex() const
Get the mutex.
Definition History.hpp:235
std::vector< CacheChange_t * > m_changes
Vector of pointers to the CacheChange_t.
Definition History.hpp:263
FASTDDS_EXPORTED_API bool remove_all_changes()
Remove all changes from the History.
std::recursive_timed_mutex RecursiveTimedMutex
Definition TimedMutex.hpp:201
Structure CacheChange_t, contains information on a specific CacheChange.
Definition CacheChange.hpp:78
Structure GUID_t, entity identifier, unique in DDS-RTPS Domain.
Definition Guid.hpp:40
Structure SequenceNumber_t, different for each change in the same writer.
Definition SequenceNumber.hpp:38