Class: QoS

vortexdds~QoS(policiesopt)

Quality of service (QoS) policy container

Twenty-one (21) QoS policies are defined, although most policies apply to only a subset of the DDS entity types. Policies that do not apply to a particular entity are ignored. The documentation for each property specifies the applicable entities.

The available QoS policies are: userdata, topicdata, groupdata, durability, durabilityService, presentation, deadline, latencyBudget, ownership, ownershipStrength, liveliness, timebasedFilter, partition, reliability, transportPriority, lifespan, destinationOrder, history, resourceLimits, writerDataLifecycle and readerDataLifecycle.

Constructor

new QoS(policiesopt)

Create a QoS object.

While creating a QoS object, all the QoS policies are initialized to the default QoS policies except for the policies that are provided and set accordingly.

Note that you should consider using one of the following factory functions to create defaults appropriate for the type of DDS entity you will be creating:

These functions return an initialized QoS object that differs from a constructed QoS object with no parameter.

Parameters:
Name Type Attributes Default Description
policies module:vortexdds~QosPolicies <optional>
null

an object defining QoS policies

Example
const dds = require('vortexdds');
const qos = new dds.QoS({
  durability: { kind: qos.DurabilityKind.Persistent },
 });

Members

deadline :module:vortexdds~DeadlinePolicy

The deadline policy.

Applies to: Topic, Reader, Writer

Type:
Example
const dds = require('vortexdds');
const qos = dds.QoS.topicDefault();
const SEC_TO_NS = 10 ^ 9;
qos.deadline = { deadline: 10 * SECS_TO_NS};

destinationOrder :module:vortexdds~DestinationOrderPolicy

The destination order policy.

Applies to: Topic, Reader, Writer

Type:
Example
const dds = require('vortexdds');
const qos = dds.QoS.topicDefault();
qos.destinationOrder = {
    kind: dds.DestinationOrderKind.BySourceTimestamp
};

durability :module:vortexdds~DurabilityPolicy

The durability policy.

Applies to: Reader, Writer, Topic

Type:
Example
const dds = require('vortexdds');
const qos = dds.QoS.writerDefault();
qos.durability.kind = dds.DurabilityKind.Persistent;

durabilityService :module:vortexdds~DurabilityServicePolicy

The durability service policy.

Applies to: Topic, Writer

You only need to provide the fields that you want to change.

Type:
Example
const dds = require('vortexdds');
const qos = dds.QoS.topicDefault();
const MS_TO_NS = 10 ^ 6;
qos.durabilityService = {
    serviceCleanupDelay: 100 * MS_TO_NS,
    historyKind: dds.HistoryKind.KeepLast,
    historyDepth: 1,
    maxSamples: 1000,
    maxInstances 100,
    maxSamplesPerInstance: 10
};

groupdata :module:vortexdds~DataPolicy

The group data policy.

Applies to: Publisher, Subscriber

When setting this policy, the value field of the passed DataPolicy may be one of:

If value is a string, it will be converted to a Buffer using the ISO-8859-1 encoding.

When retrieving the policy, the value field will be returned as a 'string' which has been ISO-8859-1 decoded from the raw binary data physically stored by DDS.

To directly retrieve the raw binary data stored by DDS, use the groupdataRaw data.

Type:

groupdataRaw :module:vortexdds~DataPolicy

The group data policy, uninterpreted

Applies to: Publisher, Subscriber

Type:

history :module:vortexdds~HistoryPolicy

The history policy.

Applies to: Reader, Writer, Topic

You only need to provide the fields that you want to change.

Type:
Example
const dds = require('vortexdds');
const qos = dds.QoS.topicDefault();
qos.history = {
    kind: dds.HistoryKind.KeepLast,
    depth: 5
};

latencyBudget :module:vortexdds~LatencyBudgetPolicy

The latency budget policy.

Applies to: Topic, Reader, Writer

Type:
Example
const dds = require('vortexdds');
const qos = dds.QoS.topicDefault();
const SEC_TO_NS = 10 ^ 9;
qos.latencyBudget = { duration: 5 * SEC_TO_NS };

lifespan :module:vortexdds~LifespanPolicy

The lifespan policy.

Applies to: Topic, Writer

Type:
Example
const dds = require('vortexdds');
const qos = dds.QoS.topicDefault();
const SECS_TO_NS = 10 ^ 9;
qos.lifespan = { lifespan: 1 * SECS_TO_NS };

liveliness :module:vortexdds~LivelinessPolicy

The liveliness policy.

Applies to: Topic, Reader, Writer

You only need to provide the fields that you want to change.

Type:
Example
const dds = require('vortexdds');
const qos = dds.QoS.topicDefault();
const MS_TO_NS = 10 ^ 6;
qos.liveliness = {
    kind: dds.LivelinessKind.Automatic,
    leaseDuration: 100 * MS_to_NS
};

ownership :module:vortexdds~OwnershipPolicy

The ownership policy.

Applies to: Topic, Reader, Writer

Type:
Example
const dds = require('vortexdds');
const qos = dds.QoS.topicDefault();
qos.ownership = {
    kind: dds.OwnershipKind.Exclusive
};

ownershipStrength :module:vortexdds~OwnershipStrengthPolicy

The ownership strength policy.

Applies to: Writer

Type:
Example
const dds = require('vortexdds');
const qos = dds.QoS.writerDefault();
qos.ownership = {
    kind: dds.OwnershipKind.Exclusive
};
qos.ownershipStrength = {
    value: 100
};

partition :module:vortexdds~PartitionPolicy

The partition policy.

Applies to: Publisher, Subscriber

We retrieving the partition policy, the names field of the returned policy object is always an array of strings.

We setting the partition policy, you may set the names field of the returned policy to be either a single string, or an array of strings.

Type:
Examples
// set a single partition
const dds = require('vortexdds');
const qos = dds.QoS.publisherDefault();
qos.partition = {names: 'mypartition'};
// set multiplpe partitions
const dds = require('vortexdds');
const qos = dds.QoS.publisherDefault();
qos.partition = {names: [
  'mypartition1',
  'mypartition2'
]};

presentation :module:vortexdds~PresentationPolicy

The presentation policy.

Applies to: Publisher, Subscriber

You only need to provide the fields that you want to change.

Note that the Node JS API for DDS only supports the Instance access scope.

Type:
Example
const dds = require('vortexdds');
const qos = dds.QoS.publisherDefault();
qos.presentation = {
 accessScope: dds.PresentationAccessScopeKind.Instance
};

readerDataLifecycle :module:vortexdds~ReaderDataLifecyclePolicy

The reader data lifecycle policy.

Applies to: Reader

You only need to provide the fields that you want to change.

Type:
Example
const dds = require('vortexdds');
const qos = dds.QoS.readerDefault();
const MS_TO_NS = 10 ^ 6;
qos.readerDataLifecycle = {
    autopurgeNoWriterSamples: 100 * MS_TO_NS,
    autopurgeDisposedSamplesDelay: 100 * MS_TO_NS
};

reliability :module:vortexdds~ReliabilityPolicy

The reliability policy.

Applies to: Topic, Reader, Writer

You only need to provide the fields that you want to change.

Type:
Example
const dds = require('vortexdds');
const qos = dds.QoS.topicDefault();
const MS_TO_NS = 10 ^ 6;
qos.reliability = {
    kind: dds.ReliabilityKind.Reliable,
    maxBlockingTime: 100 * MS_TO_NS
};

resourceLimits :module:vortexdds~ResourceLimitsPolicy

The resource limits policy.

Applies to: Reader, Writer, Topic

You only need to provide the fields that you want to change.

Type:
Example
const dds = require('vortexdds');
const qos = dds.QoS.topicDefault();
qos.resourceLimits = {
    maxSamples: 100,
    maxInstances: 10,
    maxSamplesPerInstance: 10,
};

timebasedFilter :module:vortexdds~TimebasedFilterPolicy

The time based filter policy.

Applies to: Reader

Type:
Example
const dds = require('vortexdds');
const qos = dds.QoS.readerDefault();
const MS_TO_NS = 10 ^ 6;
qos.timebasedFilter = {
    minimumSeparation: 100 * MS_TO_NS
};

topicdata :module:vortexdds~DataPolicy

The topic data policy.

Applies to: Topic When setting this policy, the value field of the passed DataPolicy may be one of:

If value is a string, it will be converted to a Buffer using the ISO-8859-1 encoding.

When retrieving the policy, the value field will be returned as a 'string' which has been ISO-8859-1 decoded from the raw binary data physically stored by DDS.

To directly retrieve the raw binary data stored by DDS, use the topicdataRaw property.

Type:

topicdataRaw :module:vortexdds~DataPolicy

The topic data policy, uninterpreted

Applies to: Topic

Type:

transportPriority :module:vortexdds~TransportPriorityPolicy

The transport priority policy.

Applies to: Topic, Writer

Type:
Example
const dds = require('vortexdds');
const qos = dds.QoS.topicDefault();
qos.transportPriority = {
    value: 100
};

userdata :module:vortexdds~DataPolicy

The user data policy.

Applies to: Participant, Reader, Writer

When setting this policy, the value field of the passed DataPolicy may be one of:

If value is a string, it will be converted to a Buffer using the ISO-8859-1 encoding.

When retrieving the policy, the value field will be returned as a 'string' which has been ISO-8859-1 decoded from the raw binary data physically stored by DDS.

To directly retrieve the raw binary data stored by DDS, use the userdataRaw data.

Type:

userdataRaw :module:vortexdds.DataPolicy

The user data policy, uninterpreted

Applies to: Participant, Reader, Writer

Type:
  • module:vortexdds.DataPolicy

writerDataLifecycle :module:vortexdds~WriterDataLifecyclePolicy

The writer data lifecycle policy.

Applies to: Writer

Type:
Example
const dds = require('vortexdds');
const qos = dds.QoS.writerDefault();
qos.writerDataLifecycle = {
    autodisposeUnregisteredInstances: false
};

Methods

(static) participantDefault() → {module:vortexdds.QoS}

Create a default QoS object suitable for creating Participant entities.

Returns:
Type
module:vortexdds.QoS

(static) publisherDefault() → {module:vortexdds.QoS}

Create a default QoS object suitable for creating Publisher entities.

Returns:
Type
module:vortexdds.QoS

(static) readerDefault() → {module:vortexdds.QoS}

Create a default QoS object suitable for creating Reader entities.

Returns:
Type
module:vortexdds.QoS

(static) subscriberDefault() → {module:vortexdds.QoS}

Create a default QoS object suitable for creating Subscriber entities.

Returns:
Type
module:vortexdds.QoS

(static) topicDefault() → {module:vortexdds.QoS}

Create a default QoS object suitable for creating Topic entities.

Returns:
Type
module:vortexdds.QoS

(static) writerDefault() → {module:vortexdds.QoS}

Create a default QoS object suitable for creating Writer entities.

Returns:
Type
module:vortexdds.QoS

delete()

This function does nothing. Previously it released the DDS memory associated with this QoS object. This class no longer retains any DDS resources.

Example
// release QoS resources after usage
const qos = QoS.subscriberDefault();
qos.partition = {name: ['foo','bar']};
const sub = dp.createSubscriber(qos);
qos.delete(); // finished with QoS object