Remove QoS duplication between DDS and DDSI
All this duplication was rather useless: the values are standardized anyway and the conversion was a simple type cast without any check. This commit unifies the definitions. * DDSI now uses the definitions of the various QoS "kind" values from the header file; * The durations in the QoS objects are no longer in wire-format representation, the conversions now happen only in conversion to/from wire format; * The core DDSI stack no longer uses DDSI time representations for time stamps, instead using the "native" one; * QoS policy ids duplication has been eliminated, again using the IDs visible in the API -- the actual values are meaningless to the DDSI stack anyway. Signed-off-by: Erik Boasson <eb@ilities.com>
This commit is contained in:
		
							parent
							
								
									13480616e0
								
							
						
					
					
						commit
						12e6946163
					
				
					 38 changed files with 1074 additions and 1242 deletions
				
			
		| 
						 | 
				
			
			@ -39,8 +39,6 @@ typedef struct dds_sequence
 | 
			
		|||
}
 | 
			
		||||
dds_sequence_t;
 | 
			
		||||
 | 
			
		||||
#define DDS_LENGTH_UNLIMITED -1
 | 
			
		||||
 | 
			
		||||
typedef struct dds_key_descriptor
 | 
			
		||||
{
 | 
			
		||||
  const char * m_name;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -21,131 +21,12 @@
 | 
			
		|||
#define DDS_QOS_H
 | 
			
		||||
 | 
			
		||||
#include "dds/export.h"
 | 
			
		||||
#include "dds/ddsc/dds_public_qosdefs.h"
 | 
			
		||||
 | 
			
		||||
#if defined (__cplusplus)
 | 
			
		||||
extern "C" {
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/* QoS identifiers */
 | 
			
		||||
/** @name QoS identifiers
 | 
			
		||||
  @{**/
 | 
			
		||||
#define DDS_INVALID_QOS_POLICY_ID 0
 | 
			
		||||
#define DDS_USERDATA_QOS_POLICY_ID 1
 | 
			
		||||
#define DDS_DURABILITY_QOS_POLICY_ID 2
 | 
			
		||||
#define DDS_PRESENTATION_QOS_POLICY_ID 3
 | 
			
		||||
#define DDS_DEADLINE_QOS_POLICY_ID 4
 | 
			
		||||
#define DDS_LATENCYBUDGET_QOS_POLICY_ID 5
 | 
			
		||||
#define DDS_OWNERSHIP_QOS_POLICY_ID 6
 | 
			
		||||
#define DDS_OWNERSHIPSTRENGTH_QOS_POLICY_ID 7
 | 
			
		||||
#define DDS_LIVELINESS_QOS_POLICY_ID 8
 | 
			
		||||
#define DDS_TIMEBASEDFILTER_QOS_POLICY_ID 9
 | 
			
		||||
#define DDS_PARTITION_QOS_POLICY_ID 10
 | 
			
		||||
#define DDS_RELIABILITY_QOS_POLICY_ID 11
 | 
			
		||||
#define DDS_DESTINATIONORDER_QOS_POLICY_ID 12
 | 
			
		||||
#define DDS_HISTORY_QOS_POLICY_ID 13
 | 
			
		||||
#define DDS_RESOURCELIMITS_QOS_POLICY_ID 14
 | 
			
		||||
#define DDS_ENTITYFACTORY_QOS_POLICY_ID 15
 | 
			
		||||
#define DDS_WRITERDATALIFECYCLE_QOS_POLICY_ID 16
 | 
			
		||||
#define DDS_READERDATALIFECYCLE_QOS_POLICY_ID 17
 | 
			
		||||
#define DDS_TOPICDATA_QOS_POLICY_ID 18
 | 
			
		||||
#define DDS_GROUPDATA_QOS_POLICY_ID 19
 | 
			
		||||
#define DDS_TRANSPORTPRIORITY_QOS_POLICY_ID 20
 | 
			
		||||
#define DDS_LIFESPAN_QOS_POLICY_ID 21
 | 
			
		||||
#define DDS_DURABILITYSERVICE_QOS_POLICY_ID 22
 | 
			
		||||
/** @}*/
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* QoS structure is opaque */
 | 
			
		||||
/** QoS structure */
 | 
			
		||||
typedef struct nn_xqos dds_qos_t;
 | 
			
		||||
 | 
			
		||||
/** Durability QoS: Applies to Topic, DataReader, DataWriter */
 | 
			
		||||
typedef enum dds_durability_kind
 | 
			
		||||
{
 | 
			
		||||
    DDS_DURABILITY_VOLATILE,
 | 
			
		||||
    DDS_DURABILITY_TRANSIENT_LOCAL,
 | 
			
		||||
    DDS_DURABILITY_TRANSIENT,
 | 
			
		||||
    DDS_DURABILITY_PERSISTENT
 | 
			
		||||
}
 | 
			
		||||
dds_durability_kind_t;
 | 
			
		||||
 | 
			
		||||
/** History QoS: Applies to Topic, DataReader, DataWriter */
 | 
			
		||||
typedef enum dds_history_kind
 | 
			
		||||
{
 | 
			
		||||
    DDS_HISTORY_KEEP_LAST,
 | 
			
		||||
    DDS_HISTORY_KEEP_ALL
 | 
			
		||||
}
 | 
			
		||||
dds_history_kind_t;
 | 
			
		||||
 | 
			
		||||
/** Ownership QoS: Applies to Topic, DataReader, DataWriter */
 | 
			
		||||
typedef enum dds_ownership_kind
 | 
			
		||||
{
 | 
			
		||||
    DDS_OWNERSHIP_SHARED,
 | 
			
		||||
    DDS_OWNERSHIP_EXCLUSIVE
 | 
			
		||||
}
 | 
			
		||||
dds_ownership_kind_t;
 | 
			
		||||
 | 
			
		||||
/** Liveliness QoS: Applies to Topic, DataReader, DataWriter */
 | 
			
		||||
typedef enum dds_liveliness_kind
 | 
			
		||||
{
 | 
			
		||||
    DDS_LIVELINESS_AUTOMATIC,
 | 
			
		||||
    DDS_LIVELINESS_MANUAL_BY_PARTICIPANT,
 | 
			
		||||
    DDS_LIVELINESS_MANUAL_BY_TOPIC
 | 
			
		||||
}
 | 
			
		||||
dds_liveliness_kind_t;
 | 
			
		||||
 | 
			
		||||
/** Reliability QoS: Applies to Topic, DataReader, DataWriter */
 | 
			
		||||
typedef enum dds_reliability_kind
 | 
			
		||||
{
 | 
			
		||||
    DDS_RELIABILITY_BEST_EFFORT,
 | 
			
		||||
    DDS_RELIABILITY_RELIABLE
 | 
			
		||||
}
 | 
			
		||||
dds_reliability_kind_t;
 | 
			
		||||
 | 
			
		||||
/** DestinationOrder QoS: Applies to Topic, DataReader, DataWriter */
 | 
			
		||||
typedef enum dds_destination_order_kind
 | 
			
		||||
{
 | 
			
		||||
    DDS_DESTINATIONORDER_BY_RECEPTION_TIMESTAMP,
 | 
			
		||||
    DDS_DESTINATIONORDER_BY_SOURCE_TIMESTAMP
 | 
			
		||||
}
 | 
			
		||||
dds_destination_order_kind_t;
 | 
			
		||||
 | 
			
		||||
/** History QoS: Applies to Topic, DataReader, DataWriter */
 | 
			
		||||
typedef struct dds_history_qospolicy
 | 
			
		||||
{
 | 
			
		||||
    dds_history_kind_t kind;
 | 
			
		||||
    int32_t depth;
 | 
			
		||||
}
 | 
			
		||||
dds_history_qospolicy_t;
 | 
			
		||||
 | 
			
		||||
/** ResourceLimits QoS: Applies to Topic, DataReader, DataWriter */
 | 
			
		||||
typedef struct dds_resource_limits_qospolicy
 | 
			
		||||
{
 | 
			
		||||
    int32_t max_samples;
 | 
			
		||||
    int32_t max_instances;
 | 
			
		||||
    int32_t max_samples_per_instance;
 | 
			
		||||
}
 | 
			
		||||
dds_resource_limits_qospolicy_t;
 | 
			
		||||
 | 
			
		||||
/** Presentation QoS: Applies to Publisher, Subscriber */
 | 
			
		||||
typedef enum dds_presentation_access_scope_kind
 | 
			
		||||
{
 | 
			
		||||
    DDS_PRESENTATION_INSTANCE,
 | 
			
		||||
    DDS_PRESENTATION_TOPIC,
 | 
			
		||||
    DDS_PRESENTATION_GROUP
 | 
			
		||||
}
 | 
			
		||||
dds_presentation_access_scope_kind_t;
 | 
			
		||||
 | 
			
		||||
/** Ignore-local QoS: Applies to DataReader, DataWriter */
 | 
			
		||||
typedef enum dds_ignorelocal_kind
 | 
			
		||||
{
 | 
			
		||||
    DDS_IGNORELOCAL_NONE,
 | 
			
		||||
    DDS_IGNORELOCAL_PARTICIPANT,
 | 
			
		||||
    DDS_IGNORELOCAL_PROCESS
 | 
			
		||||
}
 | 
			
		||||
dds_ignorelocal_kind_t;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @brief Allocate memory and initialize default QoS-policies
 | 
			
		||||
 *
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										132
									
								
								src/core/ddsc/include/dds/ddsc/dds_public_qosdefs.h
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										132
									
								
								src/core/ddsc/include/dds/ddsc/dds_public_qosdefs.h
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,132 @@
 | 
			
		|||
/*
 | 
			
		||||
 * Copyright(c) 2006 to 2018 ADLINK Technology Limited and others
 | 
			
		||||
 *
 | 
			
		||||
 * This program and the accompanying materials are made available under the
 | 
			
		||||
 * terms of the Eclipse Public License v. 2.0 which is available at
 | 
			
		||||
 * http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
 | 
			
		||||
 * v. 1.0 which is available at
 | 
			
		||||
 * http://www.eclipse.org/org/documents/edl-v10.php.
 | 
			
		||||
 *
 | 
			
		||||
 * SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/** @file
 | 
			
		||||
 *
 | 
			
		||||
 * @brief DDS C QoS API
 | 
			
		||||
 *
 | 
			
		||||
 * This header file defines the public API of QoS and Policies in the
 | 
			
		||||
 * Eclipse Cyclone DDS C language binding.
 | 
			
		||||
 */
 | 
			
		||||
#ifndef DDS_QOSDEFS_H
 | 
			
		||||
#define DDS_QOSDEFS_H
 | 
			
		||||
 | 
			
		||||
#if defined (__cplusplus)
 | 
			
		||||
extern "C" {
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#define DDS_LENGTH_UNLIMITED -1
 | 
			
		||||
 | 
			
		||||
/** QoS identifiers */
 | 
			
		||||
typedef enum dds_qos_policy_id {
 | 
			
		||||
  DDS_INVALID_QOS_POLICY_ID,
 | 
			
		||||
  DDS_USERDATA_QOS_POLICY_ID,
 | 
			
		||||
  DDS_DURABILITY_QOS_POLICY_ID,
 | 
			
		||||
  DDS_PRESENTATION_QOS_POLICY_ID,
 | 
			
		||||
  DDS_DEADLINE_QOS_POLICY_ID,
 | 
			
		||||
  DDS_LATENCYBUDGET_QOS_POLICY_ID,
 | 
			
		||||
  DDS_OWNERSHIP_QOS_POLICY_ID,
 | 
			
		||||
  DDS_OWNERSHIPSTRENGTH_QOS_POLICY_ID,
 | 
			
		||||
  DDS_LIVELINESS_QOS_POLICY_ID,
 | 
			
		||||
  DDS_TIMEBASEDFILTER_QOS_POLICY_ID,
 | 
			
		||||
  DDS_PARTITION_QOS_POLICY_ID,
 | 
			
		||||
  DDS_RELIABILITY_QOS_POLICY_ID,
 | 
			
		||||
  DDS_DESTINATIONORDER_QOS_POLICY_ID,
 | 
			
		||||
  DDS_HISTORY_QOS_POLICY_ID,
 | 
			
		||||
  DDS_RESOURCELIMITS_QOS_POLICY_ID,
 | 
			
		||||
  DDS_ENTITYFACTORY_QOS_POLICY_ID,
 | 
			
		||||
  DDS_WRITERDATALIFECYCLE_QOS_POLICY_ID,
 | 
			
		||||
  DDS_READERDATALIFECYCLE_QOS_POLICY_ID,
 | 
			
		||||
  DDS_TOPICDATA_QOS_POLICY_ID,
 | 
			
		||||
  DDS_GROUPDATA_QOS_POLICY_ID,
 | 
			
		||||
  DDS_TRANSPORTPRIORITY_QOS_POLICY_ID,
 | 
			
		||||
  DDS_LIFESPAN_QOS_POLICY_ID,
 | 
			
		||||
  DDS_DURABILITYSERVICE_QOS_POLICY_ID
 | 
			
		||||
} dds_qos_policy_id_t;
 | 
			
		||||
 | 
			
		||||
/* QoS structure is opaque */
 | 
			
		||||
/** QoS structure */
 | 
			
		||||
typedef struct dds_qos dds_qos_t;
 | 
			
		||||
 | 
			
		||||
/** Durability QoS: Applies to Topic, DataReader, DataWriter */
 | 
			
		||||
typedef enum dds_durability_kind
 | 
			
		||||
{
 | 
			
		||||
    DDS_DURABILITY_VOLATILE,
 | 
			
		||||
    DDS_DURABILITY_TRANSIENT_LOCAL,
 | 
			
		||||
    DDS_DURABILITY_TRANSIENT,
 | 
			
		||||
    DDS_DURABILITY_PERSISTENT
 | 
			
		||||
}
 | 
			
		||||
dds_durability_kind_t;
 | 
			
		||||
 | 
			
		||||
/** History QoS: Applies to Topic, DataReader, DataWriter */
 | 
			
		||||
typedef enum dds_history_kind
 | 
			
		||||
{
 | 
			
		||||
    DDS_HISTORY_KEEP_LAST,
 | 
			
		||||
    DDS_HISTORY_KEEP_ALL
 | 
			
		||||
}
 | 
			
		||||
dds_history_kind_t;
 | 
			
		||||
 | 
			
		||||
/** Ownership QoS: Applies to Topic, DataReader, DataWriter */
 | 
			
		||||
typedef enum dds_ownership_kind
 | 
			
		||||
{
 | 
			
		||||
    DDS_OWNERSHIP_SHARED,
 | 
			
		||||
    DDS_OWNERSHIP_EXCLUSIVE
 | 
			
		||||
}
 | 
			
		||||
dds_ownership_kind_t;
 | 
			
		||||
 | 
			
		||||
/** Liveliness QoS: Applies to Topic, DataReader, DataWriter */
 | 
			
		||||
typedef enum dds_liveliness_kind
 | 
			
		||||
{
 | 
			
		||||
    DDS_LIVELINESS_AUTOMATIC,
 | 
			
		||||
    DDS_LIVELINESS_MANUAL_BY_PARTICIPANT,
 | 
			
		||||
    DDS_LIVELINESS_MANUAL_BY_TOPIC
 | 
			
		||||
}
 | 
			
		||||
dds_liveliness_kind_t;
 | 
			
		||||
 | 
			
		||||
/** Reliability QoS: Applies to Topic, DataReader, DataWriter */
 | 
			
		||||
typedef enum dds_reliability_kind
 | 
			
		||||
{
 | 
			
		||||
    DDS_RELIABILITY_BEST_EFFORT,
 | 
			
		||||
    DDS_RELIABILITY_RELIABLE
 | 
			
		||||
}
 | 
			
		||||
dds_reliability_kind_t;
 | 
			
		||||
 | 
			
		||||
/** DestinationOrder QoS: Applies to Topic, DataReader, DataWriter */
 | 
			
		||||
typedef enum dds_destination_order_kind
 | 
			
		||||
{
 | 
			
		||||
    DDS_DESTINATIONORDER_BY_RECEPTION_TIMESTAMP,
 | 
			
		||||
    DDS_DESTINATIONORDER_BY_SOURCE_TIMESTAMP
 | 
			
		||||
}
 | 
			
		||||
dds_destination_order_kind_t;
 | 
			
		||||
 | 
			
		||||
/** Presentation QoS: Applies to Publisher, Subscriber */
 | 
			
		||||
typedef enum dds_presentation_access_scope_kind
 | 
			
		||||
{
 | 
			
		||||
    DDS_PRESENTATION_INSTANCE,
 | 
			
		||||
    DDS_PRESENTATION_TOPIC,
 | 
			
		||||
    DDS_PRESENTATION_GROUP
 | 
			
		||||
}
 | 
			
		||||
dds_presentation_access_scope_kind_t;
 | 
			
		||||
 | 
			
		||||
/** Ignore-local QoS: Applies to DataReader, DataWriter */
 | 
			
		||||
typedef enum dds_ignorelocal_kind
 | 
			
		||||
{
 | 
			
		||||
    DDS_IGNORELOCAL_NONE,
 | 
			
		||||
    DDS_IGNORELOCAL_PARTICIPANT,
 | 
			
		||||
    DDS_IGNORELOCAL_PROCESS
 | 
			
		||||
}
 | 
			
		||||
dds_ignorelocal_kind_t;
 | 
			
		||||
 | 
			
		||||
#if defined (__cplusplus)
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
#endif
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue