Relax constraints on topic entities

This commit changes the implementation of topics so that multiple topic
entities can exist in a single participant for the same topic.
Different entities may refer to different topic implementations
(sertopics, akin to a type support in the DDS specification).  All
entities (for the same participant) always have the same QoS, via the
new "ktopic" table in the participant.

Readers and writers are bound to a topic entity and inherit its
properties.  If a topic comes in two definitions, say one for C and one
for C++, one can have a single participant with a reader delivering the
data in C representation and another reader delivering it in C++
representation.

This changes the behaviour of create_topic and find_topic: these now (on
successful return) always return a new entity (and thus with a unique
handle), where previously these would simply return a existing one when
possible.

This also requires some small additions to the sertopic/serdata
interface.

Signed-off-by: Erik Boasson <eb@ilities.com>
This commit is contained in:
Erik Boasson 2020-01-28 21:29:14 +01:00 committed by eboasson
parent 08c9db0934
commit 27d7c72626
29 changed files with 946 additions and 530 deletions

View file

@ -130,8 +130,12 @@ CU_Test(ddsc_topic_create, duplicate, .init=ddsc_topic_init, .fini=ddsc_topic_fi
/* Creating the same topic should succeed. */
topic = dds_create_topic(g_participant, &RoundTripModule_DataType_desc, g_topicRtmDataTypeName, NULL, NULL);
CU_ASSERT_FATAL(topic > 0);
CU_ASSERT_FATAL(topic != g_topicRtmDataType);
ret = dds_delete(topic);
CU_ASSERT_EQUAL_FATAL(ret, DDS_RETCODE_OK);
/* Old topic entity should remain in existence */
ret = dds_get_parent(g_topicRtmDataType);
CU_ASSERT(ret > 0);
}
/*************************************************************************************************/
@ -201,7 +205,7 @@ CU_Test(ddsc_topic_find, valid, .init=ddsc_topic_init, .fini=ddsc_topic_fini)
dds_return_t ret;
topic = dds_find_topic(g_participant, g_topicRtmDataTypeName);
CU_ASSERT_EQUAL_FATAL(topic, g_topicRtmDataType);
CU_ASSERT_NOT_EQUAL_FATAL(topic, g_topicRtmDataType);
ret = dds_delete(topic);
CU_ASSERT_EQUAL_FATAL(ret, DDS_RETCODE_OK);