RTI Connext Micro C++ API Version 4.3.0
Loading...
Searching...
No Matches
DDSPropertyQosPolicyHelper Class Reference

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

#include <dds_cpp_infrastructure.hxx>

Static Public Member Functions

static DDS_ReturnCode_t assert_property (DDS_PropertyQosPolicy &policy, const char *name, const char *value, DDS_Boolean propagate)
 Asserts the property identified by name in the input policy.
 
static DDS_ReturnCode_t add_property (DDS_PropertyQosPolicy &policy, const char *name, const char *value, DDS_Boolean propagate)
 Adds a new property to the input policy.
 
static struct DDS_Property_tlookup_property (DDS_PropertyQosPolicy &policy, const char *name)
 Searches for a property in the input policy given its name.
 
static DDS_ReturnCode_t remove_property (DDS_PropertyQosPolicy &policy, const char *name)
 Removes a property from the input policy.
 

Detailed Description

Policy helpers that facilitate management of the properties in the input policy.

Member Function Documentation

◆ assert_property()

static DDS_ReturnCode_t DDSPropertyQosPolicyHelper::assert_property ( DDS_PropertyQosPolicy & policy,
const char * name,
const char * value,
DDS_Boolean propagate )
static

Asserts the property identified by name in the input policy.

If the property already exists, the method replaces its current value with the new one.

If the property identified by name does not exist, the method adds it to the property set.

This method increases the maximum number of elements of the policy sequence when this number is not enough to store the new property.

Precondition
policy, name and value cannot be NULL.
Parameters
policy<<in>> Input policy.
name<<in>> Property name.
value<<in>> Property value.
propagate<<in>> Indicates whether the property is propagated on discovery. Must be set to DDS_BOOLEAN_FALSE.
Returns
One of the Standard Return Codes, DDS_RETCODE_OUT_OF_RESOURCES

◆ add_property()

static DDS_ReturnCode_t DDSPropertyQosPolicyHelper::add_property ( DDS_PropertyQosPolicy & policy,
const char * name,
const char * value,
DDS_Boolean propagate )
static

Adds a new property to the input policy.

This method allocates memory to store the (name, value) pair. The memory is owned by RTI Connext DDS Micro.

If the policy sequence does not have enough capacity for the new property, this method increases it.

If the property already exists, the method fails with DDS_RETCODE_PRECONDITION_NOT_MET.

Precondition
policy, name and value cannot be NULL.
The property is not in the policy.
Parameters
policy<<in>> Input policy.
name<<in>> Property name.
value<<in>> Property value.
propagate<<in>> Indicates whether the property is propagated on discovery. Must be set to DDS_BOOLEAN_FALSE.
Returns
One of the Standard Return Codes, DDS_RETCODE_PRECONDITION_NOT_MET, DDS_RETCODE_OUT_OF_RESOURCES

◆ lookup_property()

static struct DDS_Property_t * DDSPropertyQosPolicyHelper::lookup_property ( DDS_PropertyQosPolicy & policy,
const char * name )
static

Searches for a property in the input policy given its name.

Precondition
policy and name cannot be NULL.
Parameters
policy<<in>> Input policy.
name<<in>> Property name.
Returns
The method returns the first property with the given name. If such a property does not exist, the method returns NULL.

◆ remove_property()

static DDS_ReturnCode_t DDSPropertyQosPolicyHelper::remove_property ( DDS_PropertyQosPolicy & policy,
const char * name )
static

Removes a property from the input policy.

If the property does not exist, the method fails with DDS_RETCODE_PRECONDITION_NOT_MET.

Precondition
policy and name cannot be NULL.
The property exists in the policy.
Parameters
policy<<in>> Input policy.
name<<in>> Property name.
Returns
One of the Standard Return Codes, DDS_RETCODE_PRECONDITION_NOT_MET