20 #ifndef SUBSCRIBERHISTORY_H_
21 #define SUBSCRIBERHISTORY_H_
22 #ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC
24 #include <fastdds/dds/topic/TopicDataType.hpp>
25 #include <fastdds/rtps/resources/ResourceManagement.h>
26 #include <fastrtps/qos/ReaderQos.h>
27 #include <fastdds/rtps/history/ReaderHistory.h>
28 #include <fastrtps/qos/QosPolicies.h>
29 #include <fastrtps/common/KeyedChanges.h>
30 #include <fastrtps/subscriber/SampleInfo.h>
31 #include <fastrtps/attributes/TopicAttributes.h>
47 using instance_info = std::pair<rtps::InstanceHandle_t, std::vector<rtps::CacheChange_t*>*>;
59 fastdds::dds::TopicDataType* type,
62 rtps::MemoryManagementPolicy_t mempolicy);
74 const_iterator removal,
75 bool release =
true)
override;
85 rtps::CacheChange_t* change,
86 size_t unknown_missing_changes_up_to)
override;
95 rtps::CacheChange_t* change)
override;
108 std::chrono::steady_clock::time_point& max_blocking_time);
113 std::chrono::steady_clock::time_point& max_blocking_time);
130 rtps::CacheChange_t* change);
139 rtps::CacheChange_t* change,
149 const rtps::InstanceHandle_t& handle,
150 const std::chrono::steady_clock::time_point& next_deadline_us);
159 rtps::InstanceHandle_t& handle,
160 std::chrono::steady_clock::time_point& next_deadline_us);
178 const rtps::InstanceHandle_t& handle,
183 using t_m_Inst_Caches = std::map<rtps::InstanceHandle_t, KeyedChanges>;
186 t_m_Inst_Caches keyed_changes_;
188 std::chrono::steady_clock::time_point next_deadline_us_;
196 fastdds::dds::TopicDataType* type_;
201 void* get_key_object_;
204 std::function<bool(rtps::CacheChange_t*,
size_t)> receive_fn_;
207 std::function<bool(rtps::CacheChange_t*)> complete_fn_;
216 rtps::CacheChange_t* a_change,
217 t_m_Inst_Caches::iterator& map_it);
225 bool find_key_for_change(
226 rtps::CacheChange_t* a_change,
227 t_m_Inst_Caches::iterator& map_it);
237 bool received_change_keep_all_no_key(
238 rtps::CacheChange_t* change,
239 size_t unknown_missing_changes_up_to);
241 bool received_change_keep_last_no_key(
242 rtps::CacheChange_t* change,
243 size_t unknown_missing_changes_up_to);
245 bool received_change_keep_all_with_key(
246 rtps::CacheChange_t* change,
247 size_t unknown_missing_changes_up_to);
249 bool received_change_keep_last_with_key(
250 rtps::CacheChange_t* change,
251 size_t unknown_missing_changes_up_to);
253 bool completed_change_keep_all_with_key(
254 rtps::CacheChange_t* change);
256 bool completed_change_keep_last_with_key(
257 rtps::CacheChange_t* change);
260 bool add_received_change(
261 rtps::CacheChange_t* a_change);
263 bool add_received_change_with_key(
264 rtps::CacheChange_t* a_change,
265 std::vector<rtps::CacheChange_t*>& instance_changes);
267 bool deserialize_change(
268 rtps::CacheChange_t* change,
269 uint32_t ownership_strength,
Class SampleInfo_t with information that is provided along a sample when reading data from a Subscrib...
Definition: SampleInfo.h:39
Class SubscriberHistory, container of the different CacheChanges of a subscriber.
Definition: SubscriberHistory.h:44
~SubscriberHistory() override
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 remove_change_sub(rtps::CacheChange_t *change)
This method is called to remove a change from the SubscriberHistory.
bool get_first_untaken_info(SampleInfo_t *info)
Returns information about the first untaken sample.
bool remove_change_sub(rtps::CacheChange_t *change, iterator &it)
This method is called to remove a change from the SubscriberHistory.
bool readNextData(void *data, SampleInfo_t *info, std::chrono::steady_clock::time_point &max_blocking_time)
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 w...
std::pair< bool, instance_info > lookup_instance(const rtps::InstanceHandle_t &handle, bool exact)
Get the list of changes corresponding to an instance handle.
bool completed_change(rtps::CacheChange_t *change) override
Called when a fragmented change is received completely by the Subscriber.
SubscriberHistory(const TopicAttributes &topic_att, fastdds::dds::TopicDataType *type, const fastrtps::ReaderQos &qos, uint32_t payloadMax, rtps::MemoryManagementPolicy_t mempolicy)
Constructor.
bool takeNextData(void *data, SampleInfo_t *info, std::chrono::steady_clock::time_point &max_blocking_time)
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.
iterator remove_change_nts(const_iterator removal, bool release=true) override
Remove a specific change from the history.
std::pair< rtps::InstanceHandle_t, std::vector< rtps::CacheChange_t * > * > instance_info
Definition: SubscriberHistory.h:47
Class TopicAttributes, used by the user to define the attributes of the topic associated with a Publi...
Definition: TopicAttributes.h:36
fastdds::dds::ReaderQos ReaderQos
Definition: ReaderQos.h:30
fastdds::dds::ResourceLimitsQosPolicy ResourceLimitsQosPolicy
Definition: QosPolicies.h:81
fastdds::dds::HistoryQosPolicy HistoryQosPolicy
Definition: QosPolicies.h:80
eProsima namespace.
Definition: LibrarySettingsAttributes.h:23