RTI Connext Java API  Version 6.1.0
DataTagQosPolicyHelper Class Reference

Policy helpers that facilitate management of the data tags in the input policy. More...

Static Public Member Functions

static int get_number_of_tags (DataTagQosPolicy policy)
 Gets the number of data tags in the input policy. More...
 
static void assert_tag (DataTagQosPolicy policy, String name, String value)
 Asserts the tag identified by name in the input policy. More...
 
static void add_tag (DataTagQosPolicy policy, String name, String value)
 Adds a new tag to the input policy. More...
 
static Tag lookup_tag (DataTagQosPolicy policy, String name)
 Searches by tag name for a tag in the input policy. More...
 
static void remove_tag (DataTagQosPolicy policy, String name)
 Removes a tag from the input policy. More...
 

Detailed Description

Policy helpers that facilitate management of the data tags in the input policy.

Member Function Documentation

◆ get_number_of_tags()

static int get_number_of_tags ( DataTagQosPolicy  policy)
static

Gets the number of data tags in the input policy.

Precondition
policy cannot be null.
Parameters
policy<<in>> Input policy.
Returns
Number of data tags.

References DataTagQosPolicy.tags.

◆ assert_tag()

static void assert_tag ( DataTagQosPolicy  policy,
String  name,
String  value 
)
static

Asserts the tag identified by name in the input policy.

If the tag already exists, this function replaces its current value with the new one.

If the tag identified by name does not exist, this function adds it to the tag set.

This function increases the maximum number of elements of the policy sequence by 10 when this number is not enough to store the new tag.

Precondition
policy, name and value cannot be null.
Parameters
policy<<in>> Input policy.
name<<in>> Tag name.
value<<in>> Tag value.
Returns
One of the Standard Return Codes or com.rti.dds.infrastructure.RETCODE_OUT_OF_RESOURCES.

References DataTagQosPolicyHelper.lookup_tag(), DataTagQosPolicy.tags, and Tag.value.

◆ add_tag()

static void add_tag ( DataTagQosPolicy  policy,
String  name,
String  value 
)
static

Adds a new tag to the input policy.

This function will allocate memory to store the (name, value) pair. The memory allocated is owned by RTI Connext.

If the maximum number of elements of the policy sequence is not enough to store the new tag, this function will increase it by 10.

If the tag already exists, the function will fail with com.rti.dds.infrastructure.RETCODE_PRECONDITION_NOT_MET.

Precondition
policy, name and value cannot be null.
The tag is not in the policy.
Parameters
policy<<in>> Input policy.
name<<in>> Tag name.
value<<in>> Tag value.
Returns
One of the Standard Return Codes or com.rti.dds.infrastructure.RETCODE_OUT_OF_RESOURCES or com.rti.dds.infrastructure.RETCODE_PRECONDITION_NOT_MET

References DataTagQosPolicyHelper.lookup_tag(), and DataTagQosPolicy.tags.

◆ lookup_tag()

static Tag lookup_tag ( DataTagQosPolicy  policy,
String  name 
)
static

Searches by tag name for a tag in the input policy.

Precondition
policy, name and value cannot be null.
Parameters
policy<<in>> Input policy.
name<<in>> Tag name.
Returns
The function returns the first tag with the given name. If such a tag does not exist, the function returns NULL.

References Tag.name, and DataTagQosPolicy.tags.

Referenced by DataTagQosPolicyHelper.add_tag(), DataTagQosPolicyHelper.assert_tag(), and DataTagQosPolicyHelper.remove_tag().

◆ remove_tag()

static void remove_tag ( DataTagQosPolicy  policy,
String  name 
)
static

Removes a tag from the input policy.

If the tag does not exist, the function fails with com.rti.dds.infrastructure.RETCODE_PRECONDITION_NOT_MET.

Precondition
policy and name cannot be null.
The tag is in the policy.
Parameters
policy<<in>> Input policy.
name<<in>> Tag name.
Returns
One of the Standard Return Codes or com.rti.dds.infrastructure.RETCODE_PRECONDITION_NOT_MET.

References DataTagQosPolicyHelper.lookup_tag(), and DataTagQosPolicy.tags.