RTI Connext Modern C++ API  Version 6.0.1
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
rti::core::policy::DataWriterResourceLimitsInstanceReplacementKind_def Struct Reference

<<extension>> The enumeration for DataWriter Resource Limits More...

#include <PolicyKind.hpp>

Public Types

enum  type {
  UNREGISTERED,
  ALIVE,
  DISPOSED,
  ALIVE_THEN_DISPOSED,
  DISPOSED_THEN_ALIVE,
  ALIVE_OR_DISPOSED
}
 The underlying enum type. More...
 

Detailed Description

<<extension>> The enumeration for DataWriter Resource Limits

When dds::core::policy::ResourceLimits::max_instances is reached, a dds::pub::DataWriter will try to make room for a new instance by attempting to reclaim an existing instance based on the instance replacement kind specified by rti::core::policy::DataWriterResourceLimits::instance_replacement.

Only instances whose states match the specified kinds are eligible to be replaced. In addition, an instance must have had all of its samples fully acknowledged for it to be considered replaceable.

For all kinds, a dds::pub::DataWriter will replace the oldest instance satisfying that kind. For example, when the kind is DataWriterResourceLimitsInstanceReplacementKind::UNREGISTERED_INSTANCE_REPLACEMENT, a dds::pub::DataWriter will remove the oldest, fully acknowledged, unregistered instance, if such an instance exists.

If no replaceable instance exists, the invoked function will either return with an appropriate out-of-resources return code, or in the case of a write, it may first block to wait for an instance to be acknowledged. Otherwise, the dds::pub::DataWriter will replace the old instance with the new instance, and invoke, if available, the dds::pub::DataWriterListener::on_instance_replaced to notify the user about an instance being replaced.

A dds::pub::DataWriter checks for replaceable instances in the following order, stopping once a replaceable instance is found:

If rti::core::policy::DataWriterResourceLimits::replace_empty_instances is true, a dds::pub::DataWriter first tries replacing instances that have no samples. These empty instances can be unregistered, disposed, or alive. Next, a dds::pub::DataWriter tries replacing unregistered instances. Since an unregistered instance indicates that the dds::pub::DataWriter is done modifying it, unregistered instances are replaced before instances of any other state (alive, disposed). This is the same as the DataWriterResourceLimitsInstanceReplacementKind::UNREGISTERED_INSTANCE_REPLACEMENT kind. Then, a dds::pub::DataWriter tries replacing what is specified by rti::core::policy::DataWriterResourceLimits::instance_replacement. With unregistered instances already checked, this leaves alive and disposed instances. When both alive and disposed instances may be replaced, the kind specifies whether the particular order matters (e.g., DISPOSED_THEN_ALIVE, ALIVE_THEN_DISPOSED) or not (ALIVE_OR_DISPOSED).

QoS:
rti::core::policy::DataWriterResourceLimits

Member Enumeration Documentation

The underlying enum type.

Enumerator:
UNREGISTERED 

Allows a dds::pub::DataWriter to reclaim unregistered acknowledged instances.

By default, all instance replacement kinds first attempt to reclaim an unregistered, acknowledged instance. Used in rti::core::policy::DataWriterResourceLimits::instance_replacement [default]

ALIVE 

Allows a dds::pub::DataWriter to reclaim alive, acknowledged instances.

When an unregistered, acknowledged instance is not available to reclaim, this kind allows a dds::pub::DataWriter to reclaim an alive, acknowledged instance, where an alive instance is a registered, non-disposed instance. The least recently registered or written alive instance will be reclaimed.

DISPOSED 

Allows a dds::pub::DataWriter to reclaim disposed acknowledged instances.

When an unregistered, acknowledged instance is not available to reclaim, this kind allows a dds::pub::DataWriter to reclaim a disposed, acknowledged instance. The least recently disposed instance will be reclaimed.

ALIVE_THEN_DISPOSED 

Allows a dds::pub::DataWriter first to reclaim an alive, acknowledged instance, and then, if necessary, a disposed, acknowledged instance.

When an unregistered, acknowledged instance is not available to reclaim, this kind allows a dds::pub::DataWriter to first try reclaiming an alive, acknowledged instance. If no instance is reclaimable, then it tries reclaiming a disposed, acknowledged instance. The least recently used (i.e., registered, written, or disposed) instance will be reclaimed.

DISPOSED_THEN_ALIVE 

Allows a dds::pub::DataWriter first to reclaim a disposed, acknowledged instance, and then, if necessary, an alive, acknowledged instance.

When an unregistered, acknowledged instance is not available to reclaim, this kind allows a dds::pub::DataWriter to first try reclaiming a disposed, acknowledged instance. If no instance is reclaimable, then it tries reclaiming an alive, acknowledged instance. The least recently used (i.e., disposed, registered, or written) instance will be reclaimed.

ALIVE_OR_DISPOSED 

Allows a dds::pub::DataWriter to reclaim a either an alive acknowledged instance or a disposed acknowledged instance.

When an unregistered acknowledged instance is not available to reclaim, this kind allows a dds::pub::DataWriter to reclaim either an alive, acknowledged instance or a disposed, acknowledged instance. If both instance kinds are available to reclaim, the dds::pub::DataWriter will reclaim the least recently used (i.e. disposed, registered, or written) instance.


RTI Connext Modern C++ API Version 6.0.1 Copyright © Sat Nov 23 2019 Real-Time Innovations, Inc