HISTORY
-
The HISTORY policy determines how samples are held in the data writer and data reader for a particular instance. For data writers these values are held until the publisher retrieves them and successfully sends them to all connected subscribers. For data readers these values are held until “taken” by the application. This policy applies to the topic, data reader, and data writer entities via the
history
member of their respective QoS structures. Below is the IDL related to the history QoS policy:
enum HistoryQosPolicyKind {
KEEP_LAST_HISTORY_QOS,
KEEP_ALL_HISTORY_QOS
};
struct HistoryQosPolicy {
HistoryQosPolicyKind kind;
long depth;
};
-
The “keep all” value (
KEEP_ALL_HISTORY_QOS
) specifies that all possible samples for that instance should be kept. When “keep all” is specified and the number of unread samples is equal to the “resource limits” field of
max_samples_per_instance
then any incoming samples are rejected.
-
The “keep last” value (
KEEP_LAST_HISTORY_QOS
) specifies that only the last
depth
values should be kept. When a data writer contains
depth
samples of a given instance, a write of new samples for that instance are queued for delivery and the oldest unsent samples are discarded. When a data reader contains
depth
samples of a given instance, any incoming samples for that instance are kept and the oldest samples are discarded.
-
This policy defaults to a “keep last” with a depth of one.