Policy¶
The Quality of Service (QoS) is used to specify the behavior of the Service, defining how each entity will behave. To increase the flexibility of the system, the QoS is decomposed in several QoS Policies that can be configured independently. However, there may be cases where several policies conflict. Those conflicts will make the entities to fail on enable.
Each Qos Policy has a unique ID defined in the QosPolicyId enumerator.
This ID is used in some Status instances to identify the specific Qos Policy to which the Status refers.
Safe DDS Usage
In Safe DDS, entity QoS are immutable and cannot be modified after the entity has been created.
Standard QoS Policies¶
This section explains each of the DDS standard QoS Policies:
DeadlineQosPolicy¶
This QoS policy raises an alarm when the frequency of new samples falls below a certain threshold. It is useful for cases where data is expected to be updated periodically.
On the publishing side, the deadline defines the maximum period in which the application is expected to supply a new sample. On the subscribing side, it defines the maximum period in which new samples should be received.
For Topics with keys, this QoS is applied by key.
Compatibility Rule¶
To maintain the compatibility between DeadlineQosPolicy in DataReaders and DataWriters, the offered deadline period (configured on the DataWriter) must be less than or equal to the requested deadline period (configured on the DataReader), otherwise, the entities are considered to be incompatible.
Example¶
// Construct DeadlineQosPolicy with default values
DeadlineQosPolicy deadline_policy = {};
// Set the deadline period parameter to 10 seconds and 100 nanoseconds
deadline_policy.period.seconds = 10;
deadline_policy.period.nanoseconds = 100;
DurabilityQosPolicy¶
A DataWriter can send messages throughout a Topic even if there are no DataReaders on the network. Moreover, a DataReader that joins to the Topic after some data has been written could be interested in accessing that information.
The DurabilityQoSPolicy defines how the system will behave regarding those samples that existed on the Topic before the DataReader joins. The behavior of the system depends on the value of the DurabilityQosPolicyKind.
DurabilityQosPolicyKind¶
There are two supported values:
VOLATILE_DURABILITY_QOSPast samples are ignored and a joining DataReader receives samples generated after the moment it matches.
TRANSIENT_LOCAL_DURABILITY_QOSWhen a new DataReader joins, its History is filled with past samples.
Compatibility Rule¶
To maintain the compatibility between DurabilityQosPolicy in DataReaders and DataWriters when they have different kind values, the DataWriter kind must be higher or equal to the DataReader kind. And the order between the different kinds is:
VOLATILE_DURABILITY_QOS < TRANSIENT_LOCAL_DURABILITY_QOS
Example¶
// Construct DurabilityQosPolicy with default values
DurabilityQosPolicy durability_policy = {};
// Set its kind to TRANSIENT_LOCAL_DURABILITY_QOS
durability_policy.kind = DurabilityQosPolicyKind::TRANSIENT_LOCAL_DURABILITY_QOS;
EntityFactoryQosPolicy¶
This QoS Policy controls the behavior of Entities when they act as factories for other entities.
By default, all the entities are automatically enabled on their creation. This behavior can be modified with the value of the EntityFactoryQosPolicy::autoenable_created_entities parameter.
Example¶
// Construct EntityFactoryQosPolicy with default values
EntityFactoryQosPolicy entity_factory_policy = {};
// Set the configured autoenable created entities flag to false
entity_factory_policy.autoenable_created_entities = false;
HistoryQosPolicy¶
This QoS Policy controls the behavior of the system when the value of an instance changes one or more times before it can be successfully communicated to the existing DataReader entities.
List of QoS Policy data members:
HistoryQosPolicy::kindControls if the service should deliver only the most recent values, all the intermediate values or do something in between. See HistoryQosPolicyKind for further details.
HistoryQosPolicy::depthEstablishes the maximum number of samples that must be kept on the history. It only has effect if the kind is set to
KEEP_LAST_HISTORY_QOSand it needs to be consistent with the ResourceLimitsQosPolicy, which means that its value must be lower or equal tomax_samples_per_instance.
HistoryQosPolicyKind¶
There are two possible values:
KEEP_LAST_HISTORY_QOSThe service will only attempt to keep the most recent values of the instance and discard the older ones. The maximum number of samples to keep and deliver is defined by the depth of the HistoryQosPolicy, which needs to be consistent with the ResourceLimitsQosPolicy settings. If the limit defined by depth is reached, the system will discard the oldest sample to make room for a new one.
KEEP_ALL_HISTORY_QOSThe service will attempt to keep all the values of the instance until it can be delivered to all the existing Subscribers. If this option is selected, the depth will not have any effect, so the history is only limited by the values set in ResourceLimitsQosPolicy. If the limit is reached, the behavior of the system depends on the ReliabilityQosPolicy, if its kind is BEST_EFFORT the older values will be discarded but if it is RELIABLE the service blocks the DataWriter until the old values are delivered to all existing Subscribers.
Example¶
// Construct HistoryQosPolicy with default values
HistoryQosPolicy history_policy = {};
// Retrieve and change its kind to KEEP_ALL_HISTORY_QOS
history_policy.kind = HistoryQosPolicyKind::KEEP_ALL_HISTORY_QOS;
// Set the history depth to 10 samples
history_policy.depth = 10;
LivelinessQosPolicy¶
This QoS Policy controls the mechanism used by the service to ensure that a particular entity on the network is still alive. There are different settings that allow distinguishing between applications where data is updated periodically and applications where data is changed sporadically. It also allows customizing the application regarding the kind of failures that should be detected by the liveliness mechanism.
List of QoS Policy data members:
LivelinessQosPolicy::kindThis data member establishes if the service needs to assert the liveliness automatically or if it needs to wait until the liveliness is asserted by the publishing side. See LivelinessQosPolicyKind for further details.
LivelinessQosPolicy::lease_durationAmount of time to wait since the last time the DataWriter asserts its liveliness to consider that it is no longer alive.
LivelinessQosPolicyKind¶
There are three possible values:
AUTOMATIC_LIVELINESS_QOSThe service takes the responsibility for renewing the leases at the required rates, as long as the local process where the participant is running and the link connecting it to remote participants exists, the entities within the remote participant will be considered alive. This kind is suitable for applications that only need to detect whether a remote application is still running.
The two manual modes require that the application on the publishing side asserts the liveliness periodically before the lease_duration timer expires. Publishing any new data value implicitly asserts the DataWriter’s liveliness, but it can be done explicitly by calling the
assert_liveliness()member function.MANUAL_BY_PARTICIPANT_LIVELINESS_QOSIf one of the entities in the publishing side asserts its liveliness, the service deduces that all other entities within the same DomainParticipant are also alive.
MANUAL_BY_TOPIC_LIVELINESS_QOSThis mode is more restrictive and requires that at least one instance within the DataWriter is asserted to consider that the DataWriter is alive.
Compatibility Rule¶
To maintain the compatibility between LivelinessQosPolicy in DataReaders and DataWriters, the DataWriter kind must be higher or equal to the DataReader kind. And the order between the different kinds is:
AUTOMATIC_LIVELINESS_QOS < MANUAL_BY_PARTICIPANT_LIVELINESS_QOS < MANUAL_BY_TOPIC_LIVELINESS_QOS
Additionally, the LivelinessQosPolicy::lease_duration of the DataWriter must not be greater than the LivelinessQosPolicy::lease_duration of the DataReader.
Example¶
// Construct LivelinessQosPolicy with default values
LivelinessQosPolicy liveliness_policy = {};
// Retrieve and change its kind to MANUAL_BY_TOPIC_LIVELINESS_QOS
liveliness_policy.kind = LivelinessQosPolicyKind::MANUAL_BY_TOPIC_LIVELINESS_QOS;
// Set the lease duration parameter to 10 seconds
liveliness_policy.lease_duration.seconds = 10;
liveliness_policy.lease_duration.nanoseconds = 0;
ReliabilityQosPolicy¶
This QoS Policy indicates the level of reliability offered and requested by the service.
List of QoS Policy data members:
ReliabilityQosPolicy::kindSpecifies the behavior of the service regarding delivery of the samples. See ReliabilityQosPolicyKind for further details.
ReliabilityQosPolicy::max_blocking_timeConfigures the maximum duration that the write operation can be blocked.
ReliabilityQosPolicyKind¶
There are two possible values:
BEST_EFFORT_RELIABILITY_QOSIt indicates that it is acceptable not to retransmit the missing samples, so the messages are sent without waiting for an arrival confirmation. Presumably new values for the samples are generated often enough that it is not necessary to re-send any sample. However, the data samples sent by the same DataWriter will be stored in the DataReader history in the same order they occur. In other words, even if the DataReader misses some data samples, an older value will never overwrite a newer value.
RELIABLE_RELIABILITY_QOSIt indicates that the service will attempt to deliver all samples of the DataWriter’s history expecting an arrival confirmation from the DataReader. The data samples sent by the same DataWriter cannot be made available to the DataReader if there are previous samples that have not been received yet. The service will retransmit the lost data samples in order to reconstruct a correct snapshot of the DataWriter history before it is accessible by the DataReader.
Compatibility Rule¶
To maintain the compatibility between ReliabilityQosPolicy in DataReaders and DataWriters, the DataWriter kind must be higher or equal to the DataReader kind. And the order between the different kinds is:
BEST_EFFORT_RELIABILITY_QOS < RELIABLE_RELIABILITY_QOS
Example¶
// Construct ReliabilityQosPolicy with default values
ReliabilityQosPolicy reliability_policy = {};
// Retrieve and change its kind to RELIABLE_RELIABILITY_QOS
reliability_policy.kind = ReliabilityQosPolicyKind::RELIABLE_RELIABILITY_QOS;
ResourceLimitsQosPolicy¶
This QoS Policy controls the resources that the service can use in order to meet the requirements imposed by the application and other QoS Policies.
List of QoS Policy data members:
ResourceLimitsQosPolicy::max_samplesControls the maximum number of samples that the DataWriter or DataReader can manage across all the instances associated with it. In other words, it represents the maximum samples that the middleware can store for a DataReader or DataWriter.
ResourceLimitsQosPolicy::max_instancesControls the maximum number of instances that a DataWriter or DataReader can manage.
ResourceLimitsQosPolicy::max_samples_per_instanceControls the maximum number of samples within an instance that the DataWriter or DataReader can manage.
Consistency Rule¶
To maintain the consistency within the ResourceLimitsQosPolicy, the values of the data members must follow the next conditions:
The value of
ResourceLimitsQosPolicy::max_samplesmust be higher or equal to the value ofResourceLimitsQosPolicy::max_samples_per_instance.The value established for the HistoryQosPolicy
HistoryQosPolicy::depthmust be lower or equal to the value stated forResourceLimitsQosPolicy::max_samples_per_instance.
Example¶
// Construct ResourceLimitsQosPolicy with default values
ResourceLimitsQosPolicy resource_limit_policy = {};
// Set all the configurable parameters
resource_limit_policy.max_samples = 100;
resource_limit_policy.max_samples_per_instance = 10;
resource_limit_policy.max_instances = 2;
// Check if the configured values are consistent
if (!resource_limit_policy.is_consistent())
{
std::cout << "Error: Inconsistent ResourceLimitsQosPolicy" << std::endl;
}
WriterDataLifecycleQosPolicy¶
This QoS Policy has a single autodispose_unregistered_instances attribute that controls the behavior of the DataWriter with regards to the lifecycle of the data-instances it manages, that is, the data-instances that have been either explicitly registered with the DataWriter using the register operations or implicitly by directly writing the data.
Setting it to true causes the DataWriter to dispose the instance each time it is unregistered. Setting it to false will not cause this automatic disposal upon unregistering. The application can still call one of the dispose operations prior to unregistering the instance and accomplish the same effect.
The default value is autodispose_unregistered_instances = true.
Example¶
// Construct WriterDataLifecycleQosPolicy with default values
WriterDataLifecycleQosPolicy writer_data_lifecycle_qos = {};
// Set autodispose_unregistered_instances to false
writer_data_lifecycle_qos.autodispose_unregistered_instances = false;
DataRepresentationQosPolicy¶
This QoS Policy indicates offered/requested data representation for the service. DataWriters offer a single representation. A writer will use its offered policy to communicate with its matched readers. DataReaders request one or more representations.
List of Data Representations:
XCDR_DATA_REPRESENTATIONExtended CDR Encoding version 1 (Set by default).
XCDR2_DATA_REPRESENTATIONExtended CDR Encoding version 2.
XML_DATA_REPRESENTATIONXML Data Representation (Unsupported).
If no data representation is set it is considered an INCONSISTENT_POLICY.
Compatibility Rule¶
If a DataWriter’s offered representation is contained within DataReader’s requested data representations, the offer satisfies the request and the policies are compatible. Otherwise, they are incompatible.
Example¶
// Construct DataRepresentationQosPolicy with default values (all false)
DataRepresentationQosPolicy data_representation_qos = {};
// Set XCDR representation
data_representation_qos.xcdr_data_representation = true;
// Set XML representation (Unsupported)
data_representation_qos.xml_data_representation = false;
// Set XCDR2 representation (Unsupported)
data_representation_qos.xcdr2_data_representation = false;
Safe DDS QoS Policies¶
The following QoS Policies are defined in the Safe DDS API, but they are not part of the DDS specification.
DomainParticipantWireProtocolQosPolicy¶
This QoS Policy controls the protocol used to exchange messages between the DataWriters and DataReaders at the DomainParticipant level.
List of QoS Policy data members:
DomainParticipantWireProtocolQosPolicy::guid_prefixThe prefix used to identify the DDS entities of the DomainParticipant.
DomainParticipantWireProtocolQosPolicy::lease_durationThe lease duration for the DomainParticipant.
DomainParticipantWireProtocolQosPolicy::announcement_periodThe announcement period for the DomainParticipant.
DomainParticipantWireProtocolQosPolicy::announced_locatorThe announced locator for the DomainParticipant.
DomainParticipantWireProtocolQosPolicy::use_multicast_discoveryEnable or disable multicast locators on the discovery protocol.
DomainParticipantWireProtocolQosPolicy::input_integrityThe InputIntegrityCheck configuration for received messages on the DomainParticipant.
DomainParticipantWireProtocolQosPolicy::builtin_output_integrityThe OutputIntegrityCheck configuration for the DomainParticipant builtin entities.
DomainParticipantWireProtocolQosPolicy::initial_peersThe initial peers locator list for the DomainParticipant.
DomainParticipantWireProtocolQosPolicy::extra_announced_locatorsThe extra announced locator list for the DomainParticipant.
DomainParticipantWireProtocolQosPolicy::discovery_heartbeat_periodThe heartbeat period for the discovery protocol.
DomainParticipantWireProtocolQosPolicy::discovery_acknack_delayThe delay for the discovery protocol acknowledgment.
DomainParticipantWireProtocolQosPolicy::discovery_max_samples_per_requestThe maximum number of samples that the DomainParticipant will request for each sample notification during the discovery protocol. A value of
0means that the DomainParticipant will request all the available samples.
Example¶
// Construct DomainParticipantWireProtocolQosPolicy with default values
DomainParticipantWireProtocolQosPolicy wire_protocol_config = {};
// Set GUIDPrefix
protocol::GUIDPrefix prefix = {0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C};
wire_protocol_config.guid_prefix = prefix;
// Set lease duration
wire_protocol_config.lease_duration.seconds = 20;
wire_protocol_config.lease_duration.nanoseconds = 0;
// Set announcement period
wire_protocol_config.announcement_period.seconds = 2;
wire_protocol_config.announcement_period.nanoseconds = 0;
// Set announced locator
wire_protocol_config.announced_locator = transport::Locator::from_ipv4({192, 168, 1, 21}, 8080);
// Retrieve and enable multicast discovery
wire_protocol_config.use_multicast_discovery = true;
// Add initial peers
memory::container::StaticList<transport::Locator, 1> initial_peers;
initial_peers.add(transport::Locator::from_ipv4({192, 168, 1, 22}, 8080));
wire_protocol_config.initial_peers = &initial_peers;
// Add extra announced locators
memory::container::StaticList<transport::Locator, 1> extra_announced_locators;
extra_announced_locators.add(transport::Locator::from_ipv4({192, 168, 1, 124}, 8080));
wire_protocol_config.extra_announced_locators = &extra_announced_locators;
// Set input integrity configuration
wire_protocol_config.input_integrity = protocol::InputIntegrityCheck::INPUT_INTEGRITY_CHECK_ENABLED;
// Set builtin output integrity configuration
wire_protocol_config.builtin_output_integrity = protocol::OutputIntegrityCheck::OUTPUT_INTEGRITY_CHECK_ENABLED;
DataReaderWireProtocolQosPolicy¶
This QoS Policy controls the protocol used to exchange messages between the DataWriters and DataReaders at the DataReader level.
List of QoS Policy data members:
DataReaderWireProtocolQosPolicy::output_integrityThe OutputIntegrityCheck configuration for message sent from the DataReader.
DataReaderWireProtocolQosPolicy::acknack_delayThe delay for the acknowledgment of the received messages.
DataReaderWireProtocolQosPolicy::unicast_endpoint_locatorAn optional announced unicast endpoint locator for the DataReader.
DataReaderWireProtocolQosPolicy::multicast_endpoint_locatorAn optional announced multicast endpoint locator for the DataReader.
DataReaderWireProtocolQosPolicy::max_samples_per_requestThe maximum number of samples that the DataReader will request for each sample notification. The value of
0means that the DataReader will request all the samples available.
Example¶
// Construct DataReaderWireProtocolQosPolicy with default values
DataReaderWireProtocolQosPolicy wire_protocol_config = {};
// Set builtin output integrity configuration
wire_protocol_config.output_integrity = protocol::OutputIntegrityCheck::OUTPUT_INTEGRITY_CHECK_ENABLED;
DataWriterWireProtocolQosPolicy¶
This QoS Policy controls the protocol used to exchange messages between the DataWriters and DataReaders at the DataWriter level.
List of QoS Policy data members:
DataWriterWireProtocolQosPolicy::output_integrityThe OutputIntegrityCheck configuration for message sent from the DataWriter.
DataWriterWireProtocolQosPolicy::heartbeat_periodThe heartbeat period for the DataWriter.
DataWriterWireProtocolQosPolicy::unicast_endpoint_locatorAn optional announced unicast endpoint locator for the DataWriter.
DataWriterWireProtocolQosPolicy::push_modeThe transmission mode for the DataWriter. If set to
true, the DataWriter will push the data to the DataReaders, otherwise, the DataReaders will pull the data from the DataWriter. Best effort DataWriters will be incompatible with push mode set tofalse.
DataWriterWireProtocolQosPolicy::sending_locatorAn optional sending locator for the DataWriter.
Example¶
// Construct DataWriterWireProtocolQosPolicy with default values
DataWriterWireProtocolQosPolicy wire_protocol_config = {};
// Set builtin output integrity configuration
wire_protocol_config.output_integrity = protocol::OutputIntegrityCheck::OUTPUT_INTEGRITY_CHECK_ENABLED;
TransportPriorityQosPolicy¶
This QoS Policy controls the transport priority of the data.
List of QoS Policy data members:
TransportPriorityQosPolicy::valueThe priority level of the transport for the data.
Example¶
// Construct TransportPriorityQosPolicy with default values
TransportPriorityQosPolicy transport_priority_config = {};
// Set desired transport priority value
transport_priority_config.value = 2;
PreallocMemoryConfig¶
This QoS Policy controls the resources that a certain object can use in order to meet the requirements imposed by the application.
As explained in Memory management, Safe DDS can operate in a preallocated memory mode where the referred objects or entities has the ability of having a preallocated memory pool that can increase to a maximum size.
List of QoS Policy data members:
PreallocMemoryConfig::preallocatedNumber of preallocated elements in the memory pool.
PreallocMemoryConfig::max_elementsMaximum number of elements in the memory pool.
Safe DDS defines DEFAULT_MEMORY_CONFIG as the default memory configuration for all the objects that can be configured with this QoS Policy.
For this value, the preallocated memory pool size is 0 and the maximum size is UINT32_MAX, which means that the memory pool can grow to the maximum size of the memory available.
Note
Check Memory management to understand how memory is managed in Safe DDS.
Example¶
// Construct PreallocMemoryConfig with default values
memory::container::PreallocMemoryConfig memory_config{};
// Set the configurable parameters
memory_config.preallocated = 10;
memory_config.max_elements = 1000;
DomainParticipantAllocationsQosPolicy¶
This QoS Policy controls the memory involved in the behaviour of DomainParticipant.
It contains a set of PreallocMemoryConfig QoS Policies that controls the memory pools involved in the operation of the DomainParticipant.
List of QoS Policy data members:
DomainParticipantAllocationsQosPolicy::local_participantsThe configuration of the memory used by the local DomainParticipants storage.
DomainParticipantAllocationsQosPolicy::remote_participantsThe configuration of the memory used by the remote DomainParticipants storage.
DomainParticipantAllocationsQosPolicy::local_datawritersThe configuration of the memory used by the local DataWriters storage.
DomainParticipantAllocationsQosPolicy::remote_datawritersThe configuration of the memory used by the remote DataWriters storage.
DomainParticipantAllocationsQosPolicy::local_datareadersThe configuration of the memory used by the local DataReaders storage.
DomainParticipantAllocationsQosPolicy::remote_datareadersThe configuration of the memory used by the remote DataReaders storage.
DomainParticipantAllocationsQosPolicy::local_subscriptionsThe configuration of the memory used by the local Subscriptions storage.
DomainParticipantAllocationsQosPolicy::local_publicationsThe configuration of the memory used by the local Publications storage.
DomainParticipantAllocationsQosPolicy::participant_observersThe configuration of the memory used by the ParticipantObservers storage.
DomainParticipantAllocationsQosPolicy::local_topicsThe configuration of the memory used by the local Topics storage.
DomainParticipantAllocationsQosPolicy::local_typesThe configuration of the memory used by the local Types storage.
Note
Check Memory management to understand how memory is managed in Safe DDS.
Example¶
// Construct DomainParticipantAllocationsQosPolicy with default values
DomainParticipantAllocationsQosPolicy participant_allocation_qos = {};
participant_allocation_qos.local_participants.preallocated = 10;
participant_allocation_qos.local_participants.max_elements = 1000;
participant_allocation_qos.remote_participants.preallocated = 10;
participant_allocation_qos.remote_participants.max_elements = 1000;
participant_allocation_qos.local_datawriters.preallocated = 10;
participant_allocation_qos.local_datawriters.max_elements = 1000;
participant_allocation_qos.remote_datawriters.preallocated = 10;
participant_allocation_qos.remote_datawriters.max_elements = 1000;
participant_allocation_qos.local_datareaders.preallocated = 10;
participant_allocation_qos.local_datareaders.max_elements = 1000;
participant_allocation_qos.local_datareaders.preallocated = 10;
participant_allocation_qos.local_datareaders.max_elements = 1000;
participant_allocation_qos.participant_observers.preallocated = 10;
participant_allocation_qos.participant_observers.max_elements = 1000;
participant_allocation_qos.local_topics.preallocated = 10;
participant_allocation_qos.local_topics.max_elements = 1000;
participant_allocation_qos.local_types.preallocated = 10;
participant_allocation_qos.local_types.max_elements = 1000;
TopicAllocationsQosPolicy¶
This QoS Policy controls the memory involved in the behaviour of Topic.
It contains a set of PreallocMemoryConfig QoS Policies that controls the memory pools of topic samples and topic interactions with other entities.
List of QoS Policy data members:
TopicAllocationsQosPolicy::observersMemory configuration of observers attached to the topic. This value shall match the maximum number of DataReader and DataWriter that will be attached to the topic.
TopicAllocationsQosPolicy::preallocated_samplesNumber of samples allocated upon creation of the topic.
TopicAllocationsQosPolicy::extra_payload_sizeAllowed extra payload size allocated for each sample in the topic. Defaults to 0. This value is intended to be used when handling extensible (such as Appendable or Mutable IDL types) data types that may come with a size larger than the
TypeSupport::max_serialized_sizeof the type.
Note
Check Memory management to understand how memory is managed in Safe DDS.
Example¶
// Construct TopicAllocationsQosPolicy with default values
TopicAllocationsQosPolicy topic_allocation_qos = {};
// Configure all memory parameters
topic_allocation_qos.preallocated_samples = 10;
topic_allocation_qos.observers.preallocated = 10;
topic_allocation_qos.observers.max_elements = 1000;
topic_allocation_qos.extra_payload_size = 1024;
DataWriterAllocationsQosPolicy¶
This QoS Policy controls the memory involved in the behaviour of DataWriter.
It contains a set of PreallocMemoryConfig QoS Policies and uint32_t values that controls the memory pools involved in the operation of the DataWriter.
List of QoS Policy data members:
DataWriterAllocationsQosPolicy::preallocated_instancesNumeric value with preallocated memory configuration of instances that the DataWriter can manage.
DataWriterAllocationsQosPolicy::preallocated_samples_per_instanceNumeric value with preallocated memory configuration of samples per instance that the DataWriter can manage.
DataWriterAllocationsQosPolicy::remote_readersMemory configuration of remote readers that the DataWriter can manage.
Note
Maximum elements for the instances and samples configuration is retrieved from the ResourceLimitsQosPolicy configuration of the parent DataWriterQos
Note
Check Memory management to understand how memory is managed in Safe DDS.
Example¶
// Construct DataWriterAllocationsQosPolicy with default values
DataWriterAllocationsQosPolicy datawriter_allocation_qos = {};
// Configure all memory parameters
datawriter_allocation_qos.preallocated_instances = 10;
datawriter_allocation_qos.preallocated_samples_per_instance = 10;
datawriter_allocation_qos.remote_readers.preallocated = 10;
datawriter_allocation_qos.remote_readers.max_elements = 1000;
DataReaderAllocationsQosPolicy¶
This QoS Policy controls the memory involved in the behaviour of DataReader.
It contains a set of PreallocMemoryConfig QoS Policies and uint32_t values that controls the memory pools involved in the operation of the DataWriter.
List of QoS Policy data members:
DataReaderAllocationsQosPolicy::preallocated_instancesNumeric value with preallocated memory configuration of instances that the DataReader can manage.
DataReaderAllocationsQosPolicy::preallocated_samples_per_instanceNumeric value with preallocated memory configuration of samples per instance that the DataReader can manage.
DataReaderAllocationsQosPolicy::writers_per_instanceMemory configuration of how many writes can write in a DataReader instance.
DataReaderAllocationsQosPolicy::remote_writersMemory configuration of remote writers that the DataReader can manage.
DataReaderAllocationsQosPolicy::local_writersMemory configuration of remote writers that the DataReader can manage.
Note
Maximum elements for the instances and samples configuration is retrieved from the ResourceLimitsQosPolicy configuration of the parent DataReaderQos
Note
Check Memory management to understand how memory is managed in Safe DDS.
Example¶
// Construct DataReaderAllocationsQosPolicy with default values
DataReaderAllocationsQosPolicy datareader_allocation_qos = {};
// Configure all memory parameters
datareader_allocation_qos.preallocated_instances = 10;
datareader_allocation_qos.preallocated_samples_per_instance = 10;
datareader_allocation_qos.writers_per_instance.preallocated = 10;
datareader_allocation_qos.writers_per_instance.max_elements = 1000;
datareader_allocation_qos.remote_writers.preallocated = 10;
datareader_allocation_qos.remote_writers.max_elements = 1000;
datareader_allocation_qos.local_writers.preallocated = 10;
datareader_allocation_qos.local_writers.max_elements = 1000;
Integrity Checks¶
Safe DDS provides a Cyclic Redundancy Check (CRC) mechanism to ensure the integrity of the data exchanged. The integrity data is calculated over the RTPS messages and included in the RTPS HeaderExtension submessage. It can be configured both for different levels of enforcement in the incoming packages, as well as for enabling/disabling its use for sent packages.
InputIntegrityCheck¶
Input integrity check configurations available are:
INPUT_INTEGRITY_CHECK_DISABLED: Integrity data is not processed.INPUT_INTEGRITY_CHECK_ENABLED: Integrity data is processed if present.INPUT_INTEGRITY_CHECK_REQUIRED: Integrity data is processed and messages where its not present are discarded.
OutputIntegrityCheck¶
Output integrity check configurations available are:
OUTPUT_INTEGRITY_CHECK_DISABLED: Integrity data is not sent.OUTPUT_INTEGRITY_CHECK_ENABLED: Integrity data is sent on each datagram.